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

Solution (Python):
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8') 
inf = float('inf') ;mod = 10**9+7 
mans = inf ;ans = 0 ;count = 0 ;pro = 1

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

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

ab = A % B

for i in range(B + 1):
    if ab * i % B == C:
        print("YES")
        exit()

print("NO")

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def main():
    a, b, c = map(int, input().split())
    possible = False
    for i in range(b):
        if a * i % b == c:
            possible = True
            break
    if possible:
        print("YES")
    else:
        print("NO")


if __name__ == "__main__":
    main()

Solution (Python):
a,b,c = map(int,input().split())
isOK = False
for i in range(1,100000):
    if (b * i + c) % a == 0:
        isOK = True
        break
if isOK:
    print('YES')
else:
    print('NO')

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


if (a % 2 == 0 and b % 2 == 0 and c % 2 != 0):
    print('NO')
elif (a % 2 == 0 and b % 2 != 0 and c % 2 == 0):
    print('NO')


else:
    count = 0
    while count < 10 ** 7:
        count += 1
        if ((a * count) % b == c):
            print('YES')
            exit()

    print('NO')

Solution (Python):
A, B, C = map(int, input().split())
flag = False
for i in range(10000):
    if (i*B + C) % A == 0:
        flag = True
        break
if flag:
    print('YES')
else:
    print('NO')

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

def number(a,b,c):
    num=a%b
    sumn=0
    for i in range(2,10000000):
        if sumn==c:
            print("YES")
            return
        sumn+=num
        if sumn>b:
            sumn=sumn%b
    print("NO")
number(a,b,c)

Solution (Python):
a, b, c = map(int, input().split())
m = a % b
f = False
for i in range(m):
    f |= ((i % m * b % m + c % m) % m == 0)

print("YES" if f else "NO")

Solution (Python):
a, b, c = map(int, input().split())
for y in range(1,101):
  if ((b * y + c) / a).is_integer():
    print("YES")
    exit(0)
print("NO")

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

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

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

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

n = 0
for i in range(10**6):
    n += a
    n %= b
    if n == c:
        print('YES')
        exit()

print('NO')

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

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

x = A%B
for i in range(B):
    if (x*i)%B==C:
        print('YES')
        exit()
print('NO')

Solution (Python):
A,B,C= list(map(int, input().strip().split()))
a=A%B
f="NO"
for i in range(B):
    if (a*i)%B==C:
        f="YES"
        break
print(f)

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

res=c
for i in range(10000):
  res += b
  if res % a==0:
    print('YES')
    exit()
    
print('NO')

Solution (Python):
import math
A, B, C = list(map(lambda n: int(n), input().split(" ")))
 
print("YES") if C % math.gcd(A,B) == 0 else print("NO")

Solution (Python):
import sys
A,B,C=map(int,input().split())

for i in range(10**6):
    if A*i%B==C:
        print('YES')
        sys.exit()
    else:
        continue
print('NO')

Solution (Python):
def gcd(x, y):
  while y:
    x, y = y, x%y
  return x

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

if  C % gcd(A, B) == 0 :
  print('YES')
else:
  print('NO')

Solution (Python):









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)

Solution (Python):

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

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

Solution (Python):
def resolve():
    A, B, C = map(int, input().split())
    flag = 0
    for i in range(1, B+1):
        if (A*i)%B == C:
            flag = 1
    print("YES" if flag == 1 else "NO")
resolve()

Solution (Python):
A,B,C = map(int,input().split())
ls = [A,B]
ls.sort()
rm = ls[0]
while rm != 0:
    rma = rm
    rm = ls[1] % rm
if C%rma == 0:
    print('YES')
else:
    print('NO')

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

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

Solution (Python):
from math import gcd 
a,b,c=map(int,input().split())
if gcd(a,b)==1:
    print("YES")
else:
    g=gcd(a,b)
    print("YES" if c%g==0 else "NO")

Solution (Python):



from fractions import gcd
from itertools import combinations,permutations,accumulate 

from collections import deque,defaultdict,Counter
import decimal
import re












import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
a,b,c = readInts()
dic = defaultdict(int)
start = a
while True:
    if start % b == c:
        print('YES')
        exit()
    if dic[start%b] == 1:
        print('NO')
        exit()
    dic[start%b] = 1
    
    start += a

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

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

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

ans = 'NO'
r = a%b
x = 0
for i in range(100):
    x += r
    if x%b == c:
        ans = 'YES'
        break

print(ans)

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

first_amari = A%B
next_amari=0
i=2
while(first_amari!=next_amari):
    next_amari = (A*i) % B
    if next_amari == C:
        print("YES")
        exit()
    i+=1

print("NO")

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

Solution (Python):
A, B, C = map(int, input().split())
ans = "NO"
for i in range(1,102):
    if (A*i) % B == C:
        ans = "YES"
        break
print(ans)

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

mods = []

tmp = a

while True:
    mod = tmp % b
    if mod not in mods:
        mods.append(mod)
        tmp += a
    else:
        break

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

Solution (Python):
from math import gcd
A, B, C = map(int, input().split())

if C % gcd(A,B) == 0:
    print('YES')
else:
    print('NO')

Solution (Python):
A,B,C = map(int,input().split())
flag = 0
for k in range(B):
    if (k*A)%B==C:
        flag = 1
        break
if flag==1:
    print("YES")
else:
    print("NO")

Solution (Python):
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)

Solution (Python):
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')

Solution (Python):
a, b, c = map(int, input().split())
for i in range(b+1):
    if (a*i)%b == c:
        print('YES')
        exit()
else:
    print('NO')

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

for i in range(1,101):
    if (i*A)%B == C:
        print('YES')
        exit()
print('NO')

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

Solution (Python):
import bisect,collections,copy,heapq,itertools,math,string
import sys
def S(): return sys.stdin.readline().rstrip()
def M(): return map(int,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
a, b, c = M()
ans = 'NO'
for i in range(1, 101):
    if (a*i)%b==c:
        ans = 'YES'
        break
print(ans)

Solution (Python):
import math
A, B, C = map(int, input().split())
if C % math.gcd(A, B):
  print('NO')
else:
  print('YES')

Solution (Python):
a, b, c = list(map(int, input().split()))
r = 0

for i in range(b):
    r = (r+a)%b

    if (r == c):
        print("YES")
        exit()

print("NO")

Solution (Python):
a,b,c=map(int,input().split())
res="NO"
x=a-b
for i in range(100):
    if (x*i)%b==c:
        res="YES"
print(res)

Solution (Python):
A,B,C = (int(T) for T in input().split())
Flag = False
for T in range(1,B+1):
    if (T*A)%B==C:
        Flag = True
print(['NO','YES'][Flag])

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

answer = False
for i in range(b+1):
    if (i*a)%b == c:
        answer=True
        break

if answer:
    print("YES")
else:
    print("NO")

Solution (Python):
a,b,c=map(int,input().split())
res=False
for i in range(b-1):
    if (i*a-c)%b==0:
        res=True
        break

if res:
    print("YES")
else:
    print("NO")

Solution (Python):
import math

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

print('YES' if C % math.gcd(A,B) == 0 else 'NO')

Solution (Python):
import math

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

print('YES' if C % math.gcd(A,B) == 0 else 'NO')

Solution (Python):
import math
a,b,c = map(int,input().split())
d = math.gcd(a,b)
if c % d == 0:
    print('YES')
else:
    print('NO')

Solution (Python):
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)

Solution (Python):
import math
a,b,c=map(int,input().split())
n=math.gcd(a,b)
if c%n!=0:
  print("NO")
else:
  print("YES")

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

Solution (Python):

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)

Solution (Python):
A, B, C = list(map(int, input().split()))
i = 1
d_set = set()
while(True):
    d = A*i % B
    if d == C:
        print('YES')
        break
    if d in d_set:
        print('NO')
        break
    d_set.add(d)
    i += 1

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

Solution (Python):
def gcd(m,n):
    if  m%n == 0:
        return n
    return gcd(n,m%n)

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

Solution (Python):
a, b, c = [int(x) for x in input().split()]
i = temp = 0
temp_set = set()
ans = "NO"
while temp not in temp_set:
    temp_set.add(temp)
    if temp == c:
        ans = "YES"
        break
    i += 1
    temp = (a * i) % b
print(ans)

Solution (Python):
a, b, c, = map(int , input().split())
for i in range(0 , 100100):
	if (b*i+c)%a==0:
		print("YES")
		exit()

print("NO")

Solution (Python):
a,b,c=list(map(int,input().split()))
flag=0
for itr in range(1,100000):
    if (a*itr)%b==c: 
        print('YES')
        flag=1
        break
if flag==0: print('NO')

Solution (Python):
A, B, C = [int(i) for i in input().split()]
rem = set()
for i in range(1,B+1):
    rem.add((A*i)%B)
print("YES" if C in rem else "NO")

Solution (Python):




import numpy as np

def int_mtx(N):
    x = []
    for _ in range(N):
        x.append(input())
    return x

def int_map():
    return map(int,input().split())

def int_list():
    return list(map(int,input().split()))

A,B,C = int_map()

l = set()

for i in range(0,B+1):
    l.add((A*i)%B)

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

Solution (Python):
a,b,c=map(int,input().split())
s=set()
i=1
while True:
  x=a*i%b
  if x in s:
    break
  s.add(x)
  i+=1
ans = "YES" if c in s else "NO"
print(ans)

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

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

Solution (Python):


A,B,C = [int(i) for i in input().split()]

M = []
for i in range(1,100+1):
    if (A*i)%B in M:
        break
    else:
        M.append((A*i)%B)

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

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

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    A, B, C = map(int, readline().split())

    for n in range(1, B):
        if n * A % B == C:
            print('YES')
            return

    print('NO')
    return


if __name__ == '__main__':
    main()

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

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

r=a%b

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

Solution (Python):
from sys import exit

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

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

print('NO')

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

print(ans)

Solution (Python):
a,b,c=list(map(int,input().split()))
flag=0
for itr in range(1,100000):
    if (a*itr)%b==c: 
        print('YES')
        flag=1
        break
if flag==0: print('NO')

Solution (Python):
a,b,c=map(int,input().split())
num=0
for mul in range(10**6):
    num+=a
    num%=b
    if num==c:
        print("YES")
        exit()
print("NO")

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

Solution (Python):
a,b,c=map(int,input().split())
amari = []
flag = True
i = 0
FLAG = False
while flag:
  check = b*i+c
  if check % a ==0:
    FLAG = True
    flag = False
  else:
    if 0 == amari.count(check % a):
      amari.append(check%a)
    else:
      flag = False
  i = i + 1
if FLAG:
  print("YES")
else:
  print("NO")

Solution (Python):
a, b, c = map(int, input().split())
o=0
for i in range(1, b+1):
  k = i*a
  if k%b==c:
    o+=1
if o > 0:
  print('YES')
else:
  print('NO')

Solution (Python):
A, B, C = map(int, input().split())
s = 0
ans = "NO"

for i in range(100):
    s = B * i + C
    if s % A == 0:
        ans = 'YES'
        break

print(ans)

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

from math import gcd

g=gcd(a,b)

if c%g==0:
    print('YES')
else:
    print('NO')

Solution (Python):
A,B,C=list(map(int,open(0).read().split()))
modlist=[A%B]
i=2


while True:
    divd=A*i
    if divd%B==A%B:
        break
    modlist.append(divd%B)
    i=i+1

for j in modlist:
    if j==0:
        continue
    if C%j==0:
        print('YES')
        break
    else:
        C=C%j
else:
    print('NO')

Solution (Python):
def main():
    a,b,c=map(int,input().split())
    sumi = set()
    for i in range(10**9):
        x = a*i%b
        if x in sumi:
            break
        elif x == c:
            print("YES")
            return
        else:
            sumi.add(x)
    print("NO")
    
if __name__ == "__main__":
    main()

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

startR = A % B
i = 1
while True:
    R = A*i % B
    if R == C:
        print("YES")
        break
    if i != 1:
        if R == startR:
            print("NO")
            break
    i += 1

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

startR = A % B
i = 1
while True:
    
    R = A*i % B
    if R == C:
        print("YES")
        break
    
    if i != 1:
        if R == startR:
            print("NO")
            break
    
    i += 1

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

cond = False
for n in range(a, a*b+1, a):
    if n % b == c:
        cond = True
        break

print("YES" if cond else "NO")

Solution (Python):



from fractions import gcd
from itertools import combinations,permutations,accumulate 

from collections import deque,defaultdict,Counter
import decimal
import re












import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
a,b,c = readInts()
ab = a*b
now = a
while now <= ab:
    if now % b == c:
        print('YES')
        exit()
    now += a
print('NO')

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

Solution (Python):
a, b, c = map(int, input().split())
for i in range(1, b+1):
    if (a*i)%b == c:
        print('YES')
        exit()
else:
    print('NO')

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

Solution (Python):
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    a, b, c = map(int, input().split())

    num = 2
    rem = a % b
    if rem == c:
        print('YES')
        sys.exit()
    while True:
        rem_t = (a * num) % b
        if rem_t == c:
            print('YES')
            sys.exit()
        elif rem_t == rem:
            print('NO')
            sys.exit()
        num += 1

if __name__ == '__main__':
    main()

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

ans = "NO"
for i in range(1, b + 1):
    mod = (a * i) % b
    if mod == c:
        ans = "YES"

print(ans)

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

Solution (Python):

from math import gcd

a, b, c = map(int, input().split())
print("YNEOS"[c % gcd(a, b) > 0::2])

Solution (Python):
def resolve():
    A, B, C = [int(i) for i in input().split()]
    for i in range(0, A * B + 1, A):
        if i % B == C:
            print("YES")
            return
    print("NO")


resolve()

Solution (Python):

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

st = a % b

for i in range(2, b + 1):
    ans = a * i % b

    if ans == c:
        print("YES")
        exit()
    elif ans == st:
        print("NO")
        exit()

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

for i in range(a, 100000000, a):
    if i % b == c:
        print("YES")
        exit()

print("NO")

Solution (Python):
A, B, C = list(map(int,input().split()))
r = ["NO" for i in range(B)]
for i in range(1,B+1):
    r[(A*i)%B] = "YES"
print(r[C])

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

Solution (Python):
A,B,C = map(int,input().rstrip().split(" "))
q = 0
for i in range(200):
    q += A
    if q %B == C:
        print("YES")
        break
    if i == 199:
        print("NO")

Solution (Python):
A, B, C = map(int, input().split())
print("YES" if any((A*i)%B==C for i in range(B)) else "NO")

Solution (Python):
MM = input().split()
A = int(MM[0])
B = int(MM[1])
C = int(MM[2])
count = 0
for i in range(1,B):
  if A*i%B ==C:
    count +=1
if count ==0:
  print('NO')
else:
  print('YES')

Solution (Python):


from math import gcd

def solve(a,b,c):
  d = gcd(a,b)
  if c % d == 0:
    return "YES"
  else:
    return "NO"



def main():
  a,b,c = map(int,input().split())
  print(solve(a,b,c))
  return

if __name__ == '__main__':
  main()

Solution (Python):
import math
A,B,C=map(int,input().split())
if C%math.gcd(A,B)==0:
    print("YES")
else:
    print("NO")

Solution (Python):
A, B, C = map(int, input().split())
for i in range(1, 10**6):
    if A*i % B == C:
        print("YES")
        break
else:
    print("NO")

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


def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


if C % gcd(A, B) == 0:
    print('YES')
else:
    print('NO')

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

Solution (Python):
s = input().split()

a = int(s[0])
b = int(s[1])
c = int(s[2])

check = False

for i in range(b):
    p = a * i
    if p % b == c:
        check = True
        break

if check:
    print('YES')
else:
    print('NO')

Solution (Python):


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

if 1 <= len(list(filter(lambda x: x == c, map(lambda x: x % b, range(a, a*b, a))))):
    print("YES")
else:
    print("NO")

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

print("YES" if any((A * i) % B == C for i in range(1, B + 1)) else "NO")

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

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

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

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

Solution (Python):
a, b, c = map(int, input().split())
y = False
for i in range(b):
    if (a*i)%b == c:
        y = True

if y:
    print("YES")
else:
    print("NO")

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

Solution (Python):
A, B, C = map(int, input().split())
aa = []
now = A
T = True
while T:
  if now % B == C:
    print("YES")
    T = False
    quit()
  else:
    if (now % B) not in aa:
      aa.append(now % B)
      now += A
      
    else:
      print("NO")
      quit()

Solution (Python):
def solve():
    A,B,C = map(int,input().split())
    for n in range(10**6):
        if n * A % B == C:
            print('YES')
            return
    
    else:
        print('NO')

if __name__ == '__main__':
    solve()

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

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

def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)

if (c % gcd(a, b)) == 0:
    print('YES')
else:
    print('NO')

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

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

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

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

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

can_choose = True
work = C
while True:
    work += B
    work = work % A
    if work == 0:
        break
    elif work == (C % A):
        can_choose = False
        break

if can_choose:
    print("YES")
else:
    print("NO")

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

ans = False
for i in range(1,100):
    if (A*i)%B == C:
        ans = True
        break

if ans == True:
    print('YES')
else:
    print('NO')

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

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

Solution (Python):
def readinput():
    a,b,c=map(int,input().split())
    return a,b,c

def main(a,b,c):
    amari=[0]*b
    looped=False
    x=a
    while(not looped):
        r=x%b
        if r==c:
            return 'YES'
        if amari[r]>0:
            looped=True
            return 'NO'
        else:
            amari[r]+=1
        x=x+a

if __name__=='__main__':
    a,b,c=readinput()
    ans=main(a,b,c)
    print(ans)

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

lst=[0]*101
p=a
lst[p]=1
while True:
    if p%b==c:
        print("YES")
        break
    p+=a
    p%=b
    if lst[p]==1:
        print("NO")
        break
    lst[p]=1

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

print("NO")

Solution (Python):
a,b,c = map(int,input().split())
res = 0
for i in range(b):
    res =(a * i)% b
    if res == c:
        print("YES")
        break
else:
    print("NO")

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


m = 1
while True:
    if (A * m) % B == 0:
        ans = 'NO'
        break
    elif (A * m) % B == C:
        ans = 'YES'
        break
    m += 1

print(ans)

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

for n in range(100):
    if (B*n+C)%A==0:
        print('YES')
        exit()
    else:
        continue
print('NO')

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

def main():
    for x in range(a, b*a+1, a):
        if x%b == c:
            print('YES')
            return
    print('NO')
    return
main()

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

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

Solution (Python):
a, b, c = map(int, input().split())
temp = 0
for i in range(20000):
  temp = (temp + a) % b
  if temp == c:
    print('YES')
    exit()
print('NO')

Solution (Python):

import math
from sys import stdin
input = stdin.readline


def main():
  A, B, C = list(map(int, input().split()))

  print("NO" if C % math.gcd(A, B) else "YES")


if(__name__ == '__main__'):
  main()

Solution (Python):
import sys
A,B,C = map(int,input().split())

for i in range(1,100):
    if (A*i-C)% B == 0:
        print('YES')
        sys.exit()
print('NO')

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

for n in range(1,100):
  if A*n%B == C:
    print("YES")
    exit()

print("NO")

Solution (Python):

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

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

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

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

gcd=1
for i in range(2,100):
    if a%i==0 and b%i==0:
        gcd=max(gcd,i)

if c%gcd==0:
    print("YES")
else:
    print("NO")

Solution (Python):
import sys
read = sys.stdin.read
from math import gcd
def main():
    a, b, c = map(int, input().split())
    gac = gcd(a, -b)
    if c % gac == 0:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':
    main()

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

def gcd(a,b):
  if b == 0:
    return a
  else:
    return gcd(b,a%b)
  
A,B = (A,B) if A>B else (B,A)
g = gcd(A,B)

if C%g==0:
  print('YES')
else:
  print('NO')

Solution (Python):
import sys
input = sys.stdin.readline

A, B, C = [int(x) for x in input().split()]







def GCD_by_euclid(x, y):
    if y == 0:
        return x
    else:
        return GCD_by_euclid(y, x % y)

gcd = GCD_by_euclid(A, B)
if C % gcd == 0:
    print("YES")
else:
    print("NO")

Solution (Python):
A, B, C = map(int, input().split())
i = 1
flag = False
while(A*i < A*B):
    if A*i%B == C:
        flag = True
        break
    i+=1

if(flag):
    print('YES')
else:
    print('NO')

Solution (Python):
import sys
sys.setrecursionlimit(500000)

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]


def main():
    A, B, C = mi()
    for i in range(B):
        if (A*i)%B == C:
            print('YES')
            return
    print('NO')

if __name__ == '__main__':
    main()

Solution (Python):
import sys
import math
import itertools as it
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

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

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

Solution (Python):




import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter
import itertools
import copy














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


for i in range(1,100):
    if (A*i)%B == C:
        print("YES")
        sys.exit()

print("NO")

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

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

print('NO')

Solution (Python):
a,b,c = map(int,input().split())
d = a * b
e = a

while e <= d:
    if e % b == c:
        break
    else:
        e += a

if e > d:
    print('NO')
else:
    print('YES')

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

Solution (Python):
A,B,C = map(int, input().split())
k = 1
flag = False

while A*B >= A*k:
  if A*k % B == C:
    flag = True
  k += 1

if flag:
  print('YES')
else:
  print('NO')

Solution (Python):
A,B,C = [int(i) for i in input().split()]
Flag = False

for i in range(1,B+1):
    D = i*A % B
    if D == C:
        Flag = True
        break

if Flag == True:
    print('YES')
else:
    print('NO')

Solution (Python):
def main():
    a, b, c = map(int, input().split())
    mod = []
    mul_a = a
    while True:
        if mul_a % b == 0:
            break
        else:
            mod.append(mul_a % b)
            mul_a += a

    if c in mod:
        print('YES')
    else:
        print('NO')

if __name__ == '__main__':
    main()

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

ans = ''

if a % b == 0:
    if c == 0:
        ans = 'YES'
    else:
        ans = 'NO'
else:
    k = a % b
    for x in range(101):
        if (k * x) % b == c:
            ans = 'YES'
            break
    else:
        ans = 'NO'

print(ans)

Solution (Python):
A,B,C = [int(i) for i in input().split()]
D = max(A,B)
for i in range(1,D+1):
    if A * i % B == C:
        print("YES")
        break
    if A * i % B != C and i == D:
        print("NO")