302510: CF485A. Factory

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

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 $ details in the factory storage, then by the end of the day the factory has to produce ![](https://cdn.luogu.com.cn/upload/vjudge_pic/CF485A/038ac01b57b6b4b42ddfa3264591c972127b4247.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 а 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

Input

题意翻译

## 题目描述 有一个工厂,在一天的开始时,共有x条细节(?),在这一天结束时,会生产x mod m条细节。 现在已知第一天所拥有的细节数a,以及m的值 请问,是否存在一个时刻,整个工厂会停止生产(x mod m = 0)? ## 输入输出格式 ### 输入格式: 两个整数,a 和 m ### 输出格式: 当生产会停止时,输出`Yes`,否则输出`No`

加入题单

算法标签: