We could both deposit an amount A to a 2-2 multisig wallet (E)
M => E authorized by M
P => E authorized by P
Then after everything is ok, both parties could confirm the withdrawal of to both parties' wallet
There is only one transaction to sign by two co-signers.
With the 2-2 multisig wallet setup, there are two co-signers with same power and role. In your example, two cosigners are M and P, and a transaction A can be either broadcast by M or P.
If it is initiated by M, P will check it, sign it to finalize the transaction to Bitcoin mempools.
If it is initiated by P, M will check it, sign it to finalize the transaction to Bitcoin mempools.
Creating a multisig walletHow does a multisig wallet work?