CF485A.Factory
普及/提高-
通过率:0%
AC君温馨提醒
该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。
题目描述
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 (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 а 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.
输入格式
The first line contains two integers a and m ( 1<=a,m<=105 ).
输出格式
Print "Yes" (without quotes) if the production will eventually stop, otherwise print "No".
输入输出样例
输入#1
1 5
输出#1
No
输入#2
3 6
输出#2
Yes