3008.Factory

Time Limit: 1s Memory Limit: 256MB

One industrial factory is reforming working plan. The director suggested to set a mythical detail production norm. If at the beginning of the day there were x details in the factory storage, then by the end of the day the factory has to produce 3008_1.png (remainder after dividing x by m) more details. Unfortunately, no customer has ever bought any mythical detail, so all the details produced stay on the factory.

The board of directors are worried that the production by the given plan may eventually stop (that means that there will be \alpha moment when the current number of details on the factory is divisible by m).

Given the number of details a on the first day and number m check if the production stops at some moment.

Input Format(From the terminal/stdin)

The first line contains two integers a and m (1 \le a,m \le 105).

Output Format(To the terminal/stdout)

Print "Yes" (without quotes) if the production will eventually stop, otherwise print "No".

Sample Input 1

Copy
1 5
 · \n

Sample Output 1

Copy
No
  \n

Sample Input 2

Copy
3 6
 · \n

Sample Output 2

Copy
Yes
   \n

Submit

请先 登录

© 2025 FAQs