Two blocks of mass m=5kg and M=10kg are connected by a string passing over a pulley B as shown. Another string connects the center of pulley B to the floor and passes over another pulley A as shown. An upward force F is applied at the center of pulley A. Both the pulleys are massless. Find the acceleration of blocks m and M (in m/s2) if F is 500 N