测评会员优惠活动进行中 · 开通 VIP,有效期内测评不限次 VIP 优惠中 · 测评不限次 立即查看

A9753. Factory

编程题 普及/提高-

题目描述

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 ![](/uploads/acgo/image/5fc030a9a6d1ac7f_5f3b9de728d6.jpeg) (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<=10^{5}$ ).

输出格式

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

输入输出样例

输入 #1
1 5
输出 #1
No
输入 #2
3 6
输出 #2
Yes
上一题 去做题 下一题