Problem:


Score : 200 points

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.

Sample Input 1

7 5 1

Sample Output 1

YES

For example, if you select 7 and 14, the sum 21 is congruent to 1 modulo 5.

Sample Input 2

2 2 1

Sample Output 2

NO

The sum of even numbers, no matter how many, is never odd.

Sample Input 3

1 100 97

Sample Output 3

YES

You can select 97, since you may select multiples of 1, that is, all integers.

Sample Input 4

40 98 58

Sample Output 4

YES

Sample Input 5

77 42 36

Sample Output 5

NO



Sample input:
7 5 1


Sample output:
YES

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
ans = 'No'
for k in range(1, B + 1):
    if (k * A % B == C):
        ans = 'Yes'
print(ans)

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())

for i in range(1,B+1):
  if (i*A)%B==C:
    print("Yes")
    break
else:
  print("No")

Submission status: Wrong Answer

Solution code:
a, b, c = list(map(int,input().split()))
be_c =[]
ans = 0
for i in range(b):
    be_c.append(i*a)
for i in range(b):
    if be_c[i] != 0:
        if be_c[i] % b == c:
            print('Yes')
            ans = 1
            break
        else:
            pass
    else:
        pass
if ans == 0:
    print('No')

Submission status: Wrong Answer

Solution code:
#abc056 b
a,b,c=map(int,input().split())
num=[]
i=1
n=a
while True:
    n=n*i
    x=n%b
    if x not in num:
        num.append(x)
    else:
        break
    i+=1
if c in num:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
#abc056 b
a,b,c=map(int,input().split())
num=[]
i=1
n=a
while True:
    n=n*i
    x=n%b
    if x not in num:
        num.append(x)
    else:
        break
if c in num:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
#abc056 b 
a,b,c=map(int,input().split())
if a%b==0:
    if c!=0:
        print("NO")
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
A, B, C = map(int,input().split())
if A % 2 == C % 2:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
a,b,c=[int(i) for i in input().split()]
if c in [(a*i)%b for i in range(b)]:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:

a,b,c = map(int,input().split())
l = []

if a % 2 == 0:
    print("NO")
else:
    for i in range(1,b+1):
        l.append((a * i) % b)
#    print(l)

    if l.count(c) != 0:
        print("YES")
    else:
        print("NO")

Submission status: Wrong Answer

Solution code:

a,b,c = map(int,input().split())
l = []

if a % 2 == 0:
    print("No")
else:
    for i in range(1,b+1):
        l.append((a * i) % b)
#    print(l)

    if l.count(c) != 0:
        print("YES")
    else:
        print("NO")

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, list(input().split(' ')))
flg = False

for i in range(100):
  for j in range(100):
    if (a*(i+1) == b*(j+1)+c):
      flg = True

print('Yes' if flg else 'No')

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
ans = 'No'
 
for i in range(b+1):
  if (a*i)%b == c:
    ans = 'Yes'
    break
    
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
ans = 'No'
 
for i in range(1,b+1):
  if (a*i)%b == c:
    ans = 'Yes'
    break
    
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
ans = 'No'
 
for i in range(b):
  if (a*i)%b == c:
    ans = 'Yes'
    break
    
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
ans = 'No'

for i in range(1,b+1):
  if (a*i)%b == c:
    ans = 'Yes'
    
print(ans)

Submission status: Wrong Answer

Solution code:
a, b, c = list(map(int, input().split(' ')))

checker = {}
d = a
while(True):
    m = (d - c) % b
    checker.setdefault(m, False)
    
    if m == 0:
        print('Yes')
        break
    elif checker[m]:
        print('No')
        break
    else:
        checker[m] = True
        d += a

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())

l=[]
for i in range(b):
    l.append((a*i)%b)
t=0
for i in range(len(l)):
    if l[i]==c:
        t+=1
        break
if t!=0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
import sys
a, b, c = map(int, input().split())
for i in range(1, b+1):
    if (i*a)%b==c:
        print("Yes")
        sys.exit()
print("No")

Submission status: Wrong Answer

Solution code:
import sys
a, b, c = map(int, input().split())
for i in range(b+1):
    if (i*a)%b==c:
        print("Yes")
        sys.exit()
print("No")

Submission status: Wrong Answer

Solution code:
import sys
a, b, c = map(int, input().split())
for i in range(b):
    if (i*a)%b==c:
        print("Yes")
        sys.exit()
print("No")

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if a%b!=0:
    if a%2==0 and b%2 == 0 and c%2==0:
        print("Yes")
    elif a%2==0 and b%2==1 and c%2==1:
        print("Yes")
    elif a%2==1 and b%2==0 and c%2==1:
        print("Yes")
    elif a%2==1 and b%2==1 and c%2==0:
        print("Yes")
    else:
        print("No")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if c%a==0 or c%b==0:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
if c%a==0:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline

def main():
    A, B, C = map(int, input().split())
    if C == 0 or A % B == C:
        print("Yes")
        sys.exit()
    rem = A % B
    i = 2
    ans = "No"
    while True:
        if (A * i) % B == rem:
            break
        elif (A * i) % B == C:
            ans = "Yes"
            break
        i += 1
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from fractions import gcd
a,b,c = map(int,input().split())
if c%gcd(a,b)==0:
    print("Yes")
else :
    print("No")

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
B_C = B - C
if (B_C % A == 0):
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
A, B, C = map(int,input().split())

ans = "No"

for i in range(1,B+1) :
    if (A*i)%B == C :
        ans = "Yes"

print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())


for i in range(1,100000):
    if a+(a*i)%b==c:
        print("YES")
        break
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
# coding: utf-8
a,b,c=map(int,input().split())
if b%2==0:
    if a%2==0:
        if c%2==0:
            print('YES')
        else:
            print('NO')
    else:
        if c%2==0:
            print('NO')
        else:
            print('YES')
else:
    print('YES')

Submission status: Wrong Answer

Solution code:
def gcd(a, b):
  if a < b:
    a, b = b, a
  while a % b:
    a, b = b, a % b
  return b
A, B, C = map(int, input().split())
if C % gcd(A, B):
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
print("NO" if (a%2==1 and c%2==0) or (a%2==0 and c%2==1) else "YES")

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())

for i in range(1, 110):
  if (B * i + C) % A == 0:
    print("Yes")
    exit()
print("No")

Submission status: Wrong Answer

Solution code:
import sys
a,b,c = map(int,input().split())

for i in range(1,b+1):
    if a*i % b == c:
        print("Yes")
        sys.exit()
print("No")

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
flag = False
for i in range(a):
    tmp = b*i + c
    if tmp%a == 0:
        flag = True
        break
if flag:
    print("TES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
A,B,C=map(int, input().split())
res = "NO"
for i in range(10**8):
    if (A-B*i)%C==0:
        res = "YES"
        break
print(res)

Submission status: Wrong Answer

Solution code:
A,B,C=map(int, input().split())
res = "NO"
for i in range(A//B+1):
    if (A-B*i)%C==0:
        res = "YES"
        break
print(res)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int, input().split())

flag = 0
for i in range(100):
  if a*(i+1) <= 100:
    aa = a*(i+1)
    if aa % b == c:
      print("YES")
      flag = 1
      break
if flag == 0:
  print("NO")

Submission status: Wrong Answer

Solution code:
import fractions
n,m,a=map(int,input().split())
if a%fractions.gcd(n,m)==0:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())

tmp = []
i = 1
while a % b != 0:
    a *= i
    tmp.append(a % b)
    i += 1

if c in set(tmp):
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
"""
author : halo2halo
date : 30, Jan, 2020
"""

import sys
import itertools

# import numpy as np

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

A, B, C = map(int, readline().decode('utf8').split())

bl = False
for i in range(1, 11):
    if (C + B * i) % A == 0:
        bl = True

print('YES' if bl else 'NO')

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())

for i in range(b):
    if(a*i % b == c):
        print("Yes")
        exit()
        
print("NO")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
x = any((a*i)%b==c for i in range(1,b+1))
print(x)
print("YES" if x else "NO")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
x = any((a*i)%b==c for i in range(1,b+1))
print("Yes" if x else "No")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
x = any((a*i)%b==c for i in range(1,b+1))
print(x)
print("Yes" if x else "No")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
x = any(a*i==c for i in range(1,b+1))
print("Yes" if x else "No")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
x = a%b if a>b else a
f = False
for i in range(1,b):
  if x*i == c:
    f = True
print("Yes" if f is True else "No")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
x = a%b
f = False
for i in range(1,b):
  if x*i == c:
    f = True
print("Yes" if f is True else "No")

Submission status: Wrong Answer

Solution code:
a, b, c = list(map(int, input().split()))
answer = 'NO'

def hantei(a, b, c):
    if a == 1:
        return 'YES'

    if b % 2 == 0 and c % 2 == 0:
        return 'YES'

    if b % 2 == 0 and c % 2 == 1:
        # 総和が奇数
        if a % 2 == 0:
            return 'NO'
    return 'YES'

print(hantei(a, b, c))

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
for i in range(1, 10000):
    if ((B*i)+C)%A==0:
        count=1
        break
    else:
        count=0
print("No" if count==0 else "Yes")

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
count=0
for i in range(1, 1000):
    if B*i%A==0:
        count=1
    else:
        count=0
print("No" if count==0 else "Yes")

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
for i in range(1, 1000):
    if B*i%A==0:
        count=1
    else:
        count=0
print("No" if count==0 else "Yes")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
n=0
for i in range(b):
    if a*(i+1)%b==c:
        print("Yes")
        break
    n+=1
if n==b:
    print("No")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
d=[]
num = 0
for i in range(1,b+1):
    d.append(a*i)
    if sum(d)%b == c:
        num += 1
        break
if num == 0:
    print("NO")
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
d=[]
num = 0
for i in range(0,b+1):
    d.append(a*i)
    if sum(d)%b == c:
        num += 1
        break
if num == 0:
    print("NO")
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
d=[]
num = 0
for i in range(1,b+1):
    d.append(a**i)
    if sum(d)%b == c:
        num += 1
        break
if num == 0:
    print("NO")
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
d=[]
num = 1
for i in range(b+1):
    d.append(a**i)
    if sum(d)%b == c:
        num += 1
        break
if num == 0:
    print("NO")
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
d=[]
num = 1
for i in range(1000000):
    d.append(a**i)
    if sum(d)%b == c:
        num += 1
        break
if num == 0:
    print("NO")
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())



F=0
kekka=0
i=0
l=[]

while F==0:
    A=(a*i)%b
    if A==c:
        kekka="OK"
        F=1
    else:
        if l.count(A)==0:
            l.append(A)
            i+=1
        else:
            kekka="NG"
            F=1
            
print(kekka)

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
ans = "NO"
for i in range(1,b+1):
    if a%i == c:
        ans = "YES"
        break

print(ans)

Submission status: Wrong Answer

Solution code:
a, b, c = map(int,input().split())

aj = a%2
bj = b%2
cj = c%2

if aj == bj == cj == 1 or aj == bj == cj ==0 or (aj == bj ==1 and cj ==0 ) or (aj == cj == 1 and bj == 0) or (aj == 0 and bj==cj==1):
  print("YES")
else:
  print("No")

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
A, B, C = [int(x) for x in input().split()]
AmodB = A % B
if AmodB == 0:
    if C == 0:
        print("YES")
        sys.exit()
    else:
        print("NO")
        sys.exit()

mod = [AmodB]
while True:
    if C in mod:
        print("YES")
        sys.exit()
    AmodB += AmodB
    AmodB %= B
    if AmodB in mod:
        print("NO")
        sys.exit()
    else:
        mod.append(AmodB)

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
print('YES' if A%2==C%2 else 'NO')

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())
if(A%2==0 and C%2==1):
	print("NO")
else:
	print("YES")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
print('YES' if a%b==c else 'NO')

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
flg=True
if abs(a-b)<c:
  flg=False
if b<=c:
  flg=False
if abs(a-b)%b==0:
  flg=False
print("YES" if flg else "NO")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
l=[]
for i in range(1,b+1):
    l.append((a+i)%b)
if l.count(0)>0:
    print('YES')
else:print('NO')

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
print('YES' if (a%b)%2 == c%2 else 'NO')

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
flag="No"
for i in range(1,100):
  if a*i%b==c:
    flag="Yes"
    break
print(flag)

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())

remainder = A % B
if remainder % C == 0:
    print("YES")
elif A == 1:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())

if A % B != 0:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())

for i in range(10000):
    t = a * i
    if t % b == c:
        print('Yes')
        exit()

print('No')

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())
print("NO" if A==B and C!=0 else "YES")

Submission status: Wrong Answer

Solution code:
import fractions

A,B,C = map(int, input().split())

ret = C % fractions.gcd(A,B) == 0
print('Yes' if ret else 'No')

Submission status: Wrong Answer

Solution code:
from sys import stdin

a,b,c = [int(x) for x in stdin.readline().rstrip().split()]

if a%b == c:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())
ans = False
for i in range(1,1000):
    K = i * A
    if(K % B == C):
        ans = True
        break
if(ans):
    print("YES")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())

N=[]
x=0
while x in N:
    N.append(a%b)
    x=a%b

if c in N:
    print("YES")
else:
    print("NO")

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())

N=[]
x=0
while x in N:
    N.append(a%b)
    x=a%b

if c in N:
    print("yes")
else:
    print("no")

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())

sum = 0
for i in range(1, 100, a):
  sum += i
  if sum % b == c:
    print('YES')
    exit(0)

print('NO')

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
st="NO"
for i in range(a,b*a+1):
  if i%b==c:
    st="YES"
    break

print(st)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
st="NO"
for i in range(a,b*a+1):
  if i%b==0:
    st="YES"
    break

print(st)

Submission status: Wrong Answer

Solution code:
a, b, c = [int(x) for x in input().split()]

for i in range(1, b):
    if (a * i) % b == c:
        print("YES")
        break
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b, c = [int(x) for x in input().split()]

for i in range(1, b):
    if a * i % b == c:
        print("YES")
        break
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
num = a
for i in range(b):
    if num % b == c:
        print('YES')
        break
    num += a
else:
    print('No')

Submission status: Wrong Answer

Solution code:
import time
start = time.time()
A,B,C = map(int,input().split())
flag = 0
if A == 1:
    flag = 1
else:
    while time.time()-start < 1.98:
        if A%B == C:
            flag = 1
            break
        else:
            A += A
if flag == 0:
    print("NO")
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
import time
start = time.time()
A,B,C = map(int,input().split())
flag = 0
if A == 1:
    flag = 1
else:    
    while flag == 0:
        if A%B == C:
            flag = 1
            break
        else:
            A += A
        now = time.time() - start
        if now > 1.98:
            break
if flag == 0:
    print("NO")
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
import time
start = time.time()
A,B,C = map(int,input().split())
flag = 0
if A == 1:
    flag = 1
else:    
    while flag == 0:
        if A%B == C:
            flag = 1
            break
        else:
            A += A
        now = time.time() - start
        if now > 1.9:
            break
if flag == 0:
    print("NO")
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
A,B,C = map(int, input().split())

can_divide = False
for i in range(1, B+1):
    n = A*i

    if n % B == C:
        can_divide = True

print('Yes' if can_divide else 'No')

Submission status: Wrong Answer

Solution code:
a,b,c = list(map(int, input().split()))

print("Yes" if any((a*i)%b==c for i in range(1,10)) else "No")

Submission status: Wrong Answer

Solution code:
N,M,R = map(int,input().split())
ans = ''
for i in range(M+1):
    if  (i * N) % M == R:
        ans = 'Yes'
        break;
if ans == '':
    ans = 'No'
print(ans)

Submission status: Wrong Answer

Solution code:
A,B,C = map(int, input().split())

a = A % B

if a % C == 0:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
A,B,C = map(int, input().split())
n = A
while n < 100000:
  if n % B == C:
    print("YES")
    break;
  n += A
if n > 100000:
  print("NO")

Submission status: Wrong Answer

Solution code:
A,B,C = map(int, input().split())
n = A
while n < 1000000:
  if n % B == C:
    print("YES")
    break;
  n += A
if n > 1000000:
  print("NO")

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
r = 1
for i in range(1,b+1):
  r *= a
  if r % b == c:
    print("YES")
    break
  if i == b:
    if r % b != c:
      print("NO")

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())

for i in range(1, B + 1):
    if i * A % B == 0:
        print('YES')
    else:
        print('NO')

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
A,B,C=map(int,input().split())

for i in range(A,A*B+1,A):
  if i %B==C:
    flag=True
    break
  else:
    flag=False
print('Yes' if flag else 'No')

Submission status: Wrong Answer

Solution code:
#-*- coding:utf-8 -*-
A,B,C=map(int,input().split())
number=0
record=[]
while number%B!=C:
  number+=A
  number%=B
  record.append(number)
  if number in record:
       print('NO')
       exit()
        
print('YES')

Submission status: Wrong Answer

Solution code:
"""
    選ぶ整数の数: 1~
    選ぶ整数: A*nで表現できる
    sum % B = CであればYes

    sum = A*(n1+n2+...)
    sum % B = A%B * (n1+n2+...)%B = C
    A%BがCの約数であればYes
    (A%B*n)%BがCの約数であってもYes
"""
a, b, c = map(int, input().split())
flag = False
a_mod = a % b
if a_mod == 0 and c == 0:
    flag = True
elif a_mod == 0:
    pass
# 以降 0< a_mod <b
elif c % a_mod == 0:
    flag = True
else:
    # 簡単に終わらなかったパターン
    # c % ((a%b*n)%b) == 0
    for i in range(1, b-1):
        ia_mod = (i*a_mod) % b
        if ia_mod == 0:
            continue
        elif c % ia_mod == 0:
            flag = True
            break

if flag:
    print('Yes')
else:
    print('No')

Submission status: Wrong Answer

Solution code:
a,b,c=map(int, input().split())
list=[]
for i in range(b):
    list.append(a*(i+1)%b)
print('Yes' if c in list else 'No')

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
r = set([])

temp = A % B

while temp not in r:
    r.add(temp)
    temp = temp * A % B

if C in r:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
print('Yes' if any(a*i%b==c for i in range(1, b+1)) else 'No')

Submission status: Wrong Answer

Solution code:
import fractions
a,b,c = map(int,input().split())
if fractions.gcd(a,b) == 1:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
for i in range(A,A*B):
    if i%B==C:
        print('YES')
        exit()
print('NO')

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
for i in range(A,A*B+1):
    if i%B==C:
        print('YES')
        exit()
print('NO')

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
if A==1:
    print('YES')
elif C%2==1:
    if A%2==1 and B%2==1:
        print('YES')
    else:
        print('NO')
else:
    if A%2==1 and B%2==0:
        print('NO')
    else:
        print('YES')

Submission status: Wrong Answer

Solution code:
A,B,C=map(int,input().split())
if A==1:
    print('YES')
elif C%2==1:
    if A%2==1 and B%2==1:
        print('YES')
    else:
        print('NO')
else:
    if A*B%2==1:
        print('YES')
    else:
        print('NO')

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
if c%2 and b%2==0:
    print('NO')
else:
    print('YES')

Submission status: Wrong Answer

Solution code:
#aの倍数を足して、bで割ってc余る
a, b, c = map(int, input().split())
if abs((a-b)//2) != abs(c//2) :
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())

NG_flg = 1
for i in range(B):
    if (i*(A%B))%B == C%B:
        NG_flg = 0

print("No" if NG_flg == 1 else "Yes")

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
for i in range(1,b+1):
         if (a * i) % b == c:
                  print("Yes")
                  exit()
print("No")

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())
ans = "NO"
for i in range(1,11):
    if (a*i)%b == c:
        ans = "YES"
print(ans)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
for i in range(1,101):
  if a*1%b == c:
    print("YES")
    exit()
print("NO")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
tmp=0
for i in range(1,101):
  tmp = (tmp+a*i)%b
  if tmp == c:
    print("YES")
    exit()
print("NO")

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())

if a%2 == 0 and b%2==0 and a%2 != 0:
    print("NO")
else:
    print("YES")

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())
for i in range(A,A*B+1):
  if i%B == C:
    print('YES')
    break
else:
  print('NO')

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())
for i in range(A,A*B+1):
  if i%B == C:
    print(i)
    break

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
if A%B==0:
    if C==0:
        print('YES')
    else:
        print('NO')
else:
    print('YES')

Submission status: Wrong Answer

Solution code:
#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

A, B, C = ISI()
for i in range(1, B+1):
    if A*i%B == C:
        print("Yes")
        break
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
print('YES' if a%2==0 and c%2==0 or a%2!=0 and c%2!=0 else 'NO')

Submission status: Wrong Answer

Solution code:
import sys
import copy
import  math
from _bisect import *
from collections import *
from operator import itemgetter
from math import factorial
"""
from fractions import gcd
def lcm(x, y):
    return (x * y) // gcd(x, y)
"""
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline()

a, b, c = na()
l = a % b
li = [l]
if l == 0:
    print('NO')
else:
    while True:
        num = (li[-1] + a) % b
        num %= c
        if num == 0:
            print('YES')
            break
        if num in li:
            print('NO')
            break
        li.append(num)

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
f = False
for i in range(1,b+1):
    if a * i % b == c:
        f = True
        break
if f:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
flag = True
for i in range(1, C + 1):
    if A * i % B == C:
        print("YES")
        flag = False
        break
if flag:
    print("NO")

Submission status: Wrong Answer

Solution code:
# ABC060b
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

a, b, c = map(int, input().split())

for i in range(a, a * b, a):
    if (i % b == c):
        print(i, b, i % b, c)
        # print('YES')
        exit()
print('NO')

Submission status: Wrong Answer

Solution code:
# ABC060b
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

a, b, c = map(int, input().split())

for i in range(a, a * b+1):
    if i % b == c:
        print('YES')
        exit()
print('NO')

Submission status: Wrong Answer

Solution code:
# ABC060b
import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10**6)

a, b, c = map(int, input().split())

for i in range(a, a * b):
    if i % b == c:
        print('YES')
        exit()
print('NO')

Submission status: Wrong Answer

Solution code:
from fractions import gcd
a,b,c = map(int, input().split())
if c == 0:
    print('YES')
elif gcd(a,b) == 1:
    print('YES')
else:
    print('NO')

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
a, b, c = map(int, input().split())

result = False
for i in range(1, b+1):
    sum_a = a * i

    if sum_a % b == c:
        result = True
        break

if result:
    print("Yes")
else:
    print("No")

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
lp=[(a*i%b for i in range(10*10))]
if c in lp:
  print('YES')
else:
  print('NO')

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
flag=False
for i in range(b):
  if a*i%b==c:
    flag=True
print(['No','Yes'][flag])

Submission status: Wrong Answer

Solution code:
A,B,C = map(int,input().split())
if A == 1:
  print("YES")
  exit()
  
cand = A
rem = []
while (cand % B) not in rem:
  rem.append(cand % B)
  cand *= A

if C in rem:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
x = a % b
for i in range(1, b+1):
  if x*i % b == c:
    print('Yes')
    exit()
print('No')

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())

for i in range(a,a*b,a):
  if i&b==c:
    print('YES')
    exit()
print('NO')

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())

for i in range(0,a*b):
  if a**i&b==c:
    print('YES')
    exit()
print('NO')

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
for i in range(A, A*B, A):
    if i % B == C:
        print('Yes')
        exit()
print('No')

Submission status: Wrong Answer

Solution code:
A, B, C = map(int, input().split())
for i in range(A, A*B, A):
    print(i)
    if i % B == C:
        print('Yes')
        exit()
print('No')

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
for i in range(1,10000000):
  if a*i%b == c:
    print("YES")
print("NO")

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
for i in range(1,1000000):
  if a*i%b == c:
    print("YES")
print("NO")

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
print(a,b,c)
for i in range(1,1000000):
  if a*i%b == c:
    print("YES")
print("NO")

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())
print(a,b,c)
for i in range(1,10000):
  if a*i%b == c:
    print("YES")
print("NO")

Submission status: Wrong Answer

Solution code:
a, b, c = map(int, input().split())

if a % 2 == 0:
    if (b % 2 == 1 and c % 2 == 1) or (b % 2 == 0 and c % 2 == 0):
        print('YES')
    else:
        print('NO')
else:
    if (b % 2 == 0 and c % 2 == 1) or (b % 2 == 1 and c % 2 == 0):
        print('YES')
    else:
        print('NO')

Submission status: Wrong Answer

Solution code:
a,b,c=map(int,input().split())
d = a % b
i = 1
coun=0
anslist=[]
while not(coun==2):
  i = i * a % b
  if i == d and coun == 0:
    coun = 1
  elif i == d and coun == 1:
    coun=2
  anslist+=[i]
  i += 1


if c in anslist:
  print("YES")
else:
  print("NO")

Submission status: Wrong Answer

Solution code:
a,b,c = map(int,input().split())

ans = 'No'

for i in range(1, b+1):
  if a*i % b == c:
    ans = 'Yes'

print(ans)