AtCoder Beginner Contest 060
B
Choose Integers
AtCoder
⌀ 503
原题
← AC →
翻译中…

Problem Statement

翻译中…

We ask you to select some number of positive integers, and calculate the sum of them.

翻译中…

It is allowed to select as many integers as you like, and as large integers as you wish. You have to follow these, however: each selected integer needs to be a multiple of $A$, and you need to select at least one integer.

翻译中…

Your objective is to make the sum congruent to $C$ modulo $B$. Determine whether this is possible.

翻译中…

If the objective is achievable, print YES. Otherwise, print NO.

翻译中…

Constraints

翻译中…
  • $1 ≤ A ≤ 100$
  • $1 ≤ B ≤ 100$
  • $0 ≤ C < B$
翻译中…

Input

翻译中…

Input is given from Standard Input in the following format:

翻译中…

A B C

翻译中…

Output

翻译中…

Print YES or NO.

翻译中…

样例

Input #1
7 5 1
Output #1
YES
For example, if you select $7$ and $14$, the sum $21$ is congruent to $1$ modulo $5$.
Input #2
2 2 1
Output #2
NO
The sum of even numbers, no matter how many, is never odd.
Input #3
1 100 97
Output #3
YES
You can select $97$, since you may select multiples of $1$, that is, all integers.
Input #4
40 98 58
Output #4
YES
Input #5
77 42 36
Output #5
NO
题目信息
题号
abc060_b
时间限制
2 s
内存限制
256 MB

题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。