From my understanding man-in-the middle attack works as follow:
Alice and Bob agreed to use Diffie-Hellman using $a$ and $q$. Alice sends $Y_A$. Before it reaches Bob,
Charlie intercepts it and sends $Y_{C1}$ instead. Bob believes to have agreed on a key $K_B$ with Alice, but
the key is actually only shared by Bob and Charlie since $K_B = a^{X_{C1}X_B} \mod q$.
Bob sends back $Y_B$, and it is again intercepted by Charlie. Charlie sends $Y_{C2}$ instead, and Alice sees that Bob has replied. Alice believes to have agreed on a key $K_A$ with bob, but they key is actually only shared by Alice and Charlie since $K_A = a^{X_{C1}X_A} \mod q$.
So how does meet-in-the middle attack compare to this example?