#P4863. Factory

Factory

Factory

题面翻译

题目描述

有一个工厂,在一天的开始时,共有x条细节(?),在这一天结束时,会生产x mod m条细节。

现在已知第一天所拥有的细节数a,以及m的值

请问,是否存在一个时刻,整个工厂会停止生产(x mod m = 0)?

输入输出格式

输入格式:

两个整数,a 和 m

输出格式:

当生产会停止时,输出Yes,否则输出No

题目描述

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 x details in the factory storage, then by the end of the day the factory has to produce (remainder after dividing x x by m 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 а moment when the current number of details on the factory is divisible by m m ).

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

输入格式

The first line contains two integers a a and m m ( 1<=a,m<=105 1<=a,m<=10^{5} ).

输出格式

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

样例 #1

样例输入 #1

1 5

样例输出 #1

No

样例 #2

样例输入 #2

3 6

样例输出 #2

Yes