跳到主要内容
图灵 OJTURING / ONLINE JUDGE

#F1851. Factory

  • ID: 1857
  • 传统题
  • 2000ms
  • 256MiB
  • 尝试: 0
  • AC · 已通过: 0
  • 教学难度:基础
  • 上传者:
  • 模拟
  • 数学
  • 矩阵运算
  • 编程与模拟
  • 基础
  • 难度
  • 共享题库
  • Codeforces
  • 英文题面
  • 题目来源
  • 题面语言

Factory

题目描述

A. Factory
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

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.

Input

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

Output

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

Examples
Input
1 5
Output
No
Input
3 6
Output
Yes

题目来源:fps-www.educg.net-codeforce-1-2833.xml.zip;FPS 共享题包,题包内第 1422 题。保留原作者与原赛事署名。