Here is Canvas object wihch demonstrate the problem.

Case 1:
The concentrated load at P will cause the beam to deflect downward. At support A, the beam will rotate clockwise, and thus the slope of the beam will be negative.

Case 2:
The concentrated moment M0 will cause the beam to deflect upward, rotating the beam counterclockwise at A (positive slope).

Expressions for the beam slope at A for cases 1 and 2 will be determined. These expressions will be added to express the overall slope at A. From the problem statement, it is known that the overall slope must be zero. From this fact, the magnitude of the moment M0 will be determined.