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, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B, C = MAP()

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

Solution (Python):
def myAnswer(A:int,B:int,C:int) -> int:
   for i in range(1,B+1):
      if(A*i % B == C):
         return "YES"
   else:
      return "NO"

def modelAnswer():
   return
def main():
   A,B,C = map(int,input().split())
   print(myAnswer(A,B,C))

if __name__ == '__main__':
   main()

Solution (Python):
A, B, C = map(int,input().split())
residual = A%B
satisfy = False
for i in range(B):
   if (residual*i) % B == C:
      satisfy = True
      break

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

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
def ism():return map(str,input().split())
def isl():return list(map(str,input().split()))

a,b,c = iim()

l = [i*(a%b)%b for i in range(b)]

print('YES' if c in l else '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 main():
    import sys
    input = sys.stdin.readline
    A, B, C = map(int, input().split())
    x = A % B
    for _ in range(B):
        x += A
        x %= B
        if x == C:
            print("YES")
            break
    else:
        print("NO")

if __name__ == '__main__':
    main()

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

L=[]
for i in range(1,100000):
    X=A*i%B
    if X not in L:
        L.append(X)
    else:
        break
if C in L:
    print("YES")
else:
    print("NO")

Solution (Python):
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) 
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    


MOD = 10**9 + 7
INF = 2**31  

from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  



A, B, C = read_ints()






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

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

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

valid = False
for i in range(0, B):
    if (i * A) % B == C:
        valid = True
        break
if valid:
    print("YES")
else:
    print("NO")

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

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

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

print('NO')

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

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

for k in range(1,101):
    if (A*k)%B == C:
        print("YES")
        exit(0)
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 = map(int, input().split())
A = a
for i in range(10**7 + 1):
    A += a
    if A%b == c:
        print("YES")
        exit()
print("NO")

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

a,b,c = inpl()
now = 0
for i in range(10**5):
    now += a
    if now%b == c:
        print('YES')
        break
else:
    print('NO')

Solution (Python):
a,b,c=map(int,input().split())
r=a%b
s=[]
t=0
for i in range(101):
  t+=r
  t%=b
  s.append(t)
for ss in s:
  if ss==c:
    print("YES")
    exit(0)
print("NO")

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

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

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

print("NO")

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

Solution (Python):
def resolve():
  a, b, c = map(int, input().split())
  for i in range(1, 100):
    if a * i % b == c:
      print("YES")
      return
  print("NO")
  return

if __name__ == "__main__":
  resolve()

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

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

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

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

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

print('NO')

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

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

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

Solution (Python):
def resolve():
    '''
    code here
    '''

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

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


if __name__ == "__main__":
    resolve()

Solution (Python):
from fractions import gcd

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

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

Solution (Python):
def gcd(a,b):
  while b:
    a,b = b,a%b
  return a

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

Solution (Python):

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

t = a
s = 0
while True:
    s = (t % b) % b
    t += a
    if s == c:
        print('YES')
        break
    elif s == 0:
        print('NO')
        break

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

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

cand = [(i+1)*A for i in range(B)]
rs = [c%B for c in cand]

print("YES" if C in rs else "NO")

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

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

Solution (Python):
import sys
import os
import math
import string

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: x * y / math.gcd(x, y)

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A, B, C = il()
    t = 0
    for n in range(B + 1):
        t = A * n
        if t % B == C:
            print('YES')
            exit()
    else:
        print('NO')


if __name__ == '__main__':
    main()

Solution (Python):


import fractions

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

d=fractions.gcd(a,b)

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

Solution (Python):
_input = list(map(int, input().split(" ")))
a = _input[0]
b = _input[1]
c = _input[2]

check_limit = a * b
ratio = 1
remain_list = []

while (True):
  remain_list.append(a * ratio % b)
  ratio += 1

  if ratio > b:
    break

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

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

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

print("NO")

Solution (Python):
A,B,C=list(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())
for num in range(1,b):
	if a*num%b==c :	
		print("YES");exit(0);
print("NO")

Solution (Python):
a,b,c =input().split()
a=int(a)
b=int(b)
c=int(c)
f=0
for num in range(1,b):
	d=a*num
	d%=b
	if d==c :
		f=1
if f:	
	print("YES")
else:
	print("NO")

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

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

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

f = False
for i in range(1, 10000):
    used = set([])
    if (a*i)%b == c:
        f = True
        break
    if (a*i)%b in used:
        break
    else:
        used.add((a*i)%b)
if f:
    print('YES')
else:
    print('NO')

Solution (Python):
a,b,c = map(int,input().split(' '))
i = 1
ans = 'NO'
while i < b:
    if (i*a)%b == c:
        ans = 'YES'
        break
    i += 1
print(ans)

Solution (Python):
if __name__ == '__main__':
    a,b,c = map(int,input().split())

    list = []
    count = 1
    while True:
        d = count * a % b
        if  d==c:
            print("YES")
            break
        else:
            if d in list:
                print("NO")
                break
            else:
                list.append(d)
                count+=1

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

ans = 'NO'

for i in range(1, B - 1):
    if (i * A) % B == C:
        ans = 'YES'
        break
print(ans)

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

print(ans)

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

Solution (Python):
icase=0
from fractions import gcd

if icase==0:
    a,b,c=map(int,input().split())
    if gcd(b,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 (i*A) % B == C:
        ans ="YES"

print(ans)

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

Solution (Python):
n,m,k=map(int,input().split())
for i in range(1,100):
	if (n*i)%m==k:
		print("YES")
		exit()
print("NO")

Solution (Python):
from fractions import gcd

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

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

Solution (Python):
a , b , c =map(int,input().split())
p = [i for i in range(1,a)]
k = c
while True:
    k = (k + b) % a
    if k == 0:
        print("YES")
        exit()
    elif p.count(k) == 0:
        print("NO")
        exit()
    elif p.count(k) == 1:
        p.remove(k)

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

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

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

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

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

print(ans)

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

    finish = False
    for i in range(1001):
        num = (1 + i)*A
        if num % B == C:
            print("YES")
            finish = True
            break
           
    if finish == False:
        print("NO")
main()

Solution (Python):
A,B,C = map(int,input().split())
a = 0
for i in range(B):
    if i*A%B==C : a += 1

print("NO" if a == 0 else "YES")

Solution (Python):
a,b,c=map(int,input().split())
d=a%b
e=(d*2)%b
i=3
f=[]
f.append(d)
f.append(e)
while e!=d:
  x=d*i
  e=x%b
  i+=1
  f.append(e)

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

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

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

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

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

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

ans = 'NO'
if a < b and c%a == 0:
  ans = 'YES'
else:
  for i in range(1, 100):
    if (b*i + c)%a == 0:
      ans = 'YES'
      break
  
print(ans)

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

ans = 'NO'
if a < b and c%a == 0:
  ans = 'YES'
else:
  for i in range(1, 1000):
    if (b*i + c)%a == 0:
      ans = 'YES'
      break
  
print(ans)

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

ans = 'NO'
if a < b and c%a == 0:
  ans = 'YES'
else:
  for i in range(1, 10000):
    if (b*i + c)%a == 0:
      ans = 'YES'
      break
  
print(ans)

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

ans = 'NO'
if a < b and c%a == 0:
  ans = 'YES'
else:
  for i in range(1, 100000):
    if (b*i + c)%a == 0:
      ans = 'YES'
      break
  
print(ans)

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

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

print(ans)

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

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

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

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

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

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

print('NO')

Solution (Python):

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

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

print(canSelect)

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

flag = 0
for i in range(B+1):
    if (A * i) % B == C:
        flag = 1
    else:
        pass

if flag == 1:
    print("YES")
else:
    print("NO")

Solution (Python):
from sys import stdin

A, B, C = [int(x) for x in stdin.readline().rstrip().split()]

A_mod = A
B_mod = B

while B_mod != 0:
    A_mod = A_mod % B_mod
    if A_mod == 0:
        res_mod = B_mod
        break
    B_mod = B_mod % A_mod
    if B_mod == 0:
        res_mod = A_mod
        break

check = C % res_mod
if check == 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())
k = A % B
if k == 0:
    ans = 'YES' if C == 0 else 'NO'
else:
    for i in range(1, 101):
        if (i * k) % B == C:
            ans = 'YES'
            break
    else:
        ans = 'NO'
print(ans)

Solution (Python):
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
from itertools import permutations,combinations,groupby
import sys,bisect,string,math,time,functools,random
def Golf():*a,=map(int,open(0))
def I():return int(input())
def S_():return input()
def IS():return input().split()
def LS():return [i for i in input().split()]
def LI():return [int(i) for i in input().split()]
def LI_():return [int(i)-1 for i in input().split()]
def NI(n):return [int(input()) for i in range(n)]
def NI_(n):return [int(input())-1 for i in range(n)]
def StoLI():return [ord(i)-97 for i in input()]
def ItoS(n):return chr(n+97)
def LtoS(ls):return ''.join([chr(i+97) for i in ls])
def GI(V,E,Directed=False,index=0):
    org_inp=[];g=[[] for i in range(n)]
    for i in range(E):
        inp=LI();org_inp.append(inp)
        if index==0:inp[0]-=1;inp[1]-=1
        if len(inp)==2:
            a,b=inp;g[a].append(b)
            if not Directed:g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp;aa=(inp[0],inp[2]);bb=(inp[1],inp[2]);g[a].append(bb)
            if not Directed:g[b].append(aa)
    return g,org_inp
def GGI(h,w,boundary=1,search=[],replacement_of_found='.',mp_def={'

    mp=[boundary]*(w+2);found={}
    for i in range(h):
        s=input()
        for char in search:
            if char in s:
                found[char]=((i+1)*(w+2)+s.index(char)+1)
                mp_def[char]=mp_def[replacement_of_found]
        mp+=[boundary]+[mp_def[j] for j in s]+[boundary]
    mp+=[boundary]*(w+2)
    return h+2,w+2,mp,found
def TI(n):return GI(n,n-1)
def bit_combination(k,n=2):return [[tb//(n**bt)%n for bt in range(k)] for tb in range(n**k)]
def show(*inp,end='\n'):
    if show_flg:print(*inp,end=end)
def show2d(g,h,w):
    for i in range(h):show(g[i*w:i*w+w])

YN=['YES','NO'];Yn=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase

input=lambda: sys.stdin.readline().rstrip()

show_flg=False
show_flg=True

import fractions
a,b,c=LI()
d=fractions.gcd(a,b)
print(YN[c%d!=0])

Solution (Python):


x=input().split(" ")
a=int(x[0])
b=int(x[1])
c=int(x[2])
d=b*c

ans=0
for i in range(d):
    if a*i%b==c:
        ans=1
if ans==1:
    print("YES")
else:
    print("NO")

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

for i in range(10**5):
    n = a * i
    if n % b == c:
        print('YES')
        quit()
print('NO')

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

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

Solution (Python):
a, b, c = map(int, input().split())
h = {}
ans = "NO"
n = a
while not n % b in h:
    if (n % b) == c:
        ans = "YES"
        break
    h[n % b] = 1
    n += a
print(ans)

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

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

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

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

i = 0
s = 0
while True:
    if A * i % B == C:
        print('YES')
        break
    if A * i % B == 0 and i != 0:
        print('NO')
        break
    i += 1

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

Solution (Python):
a,b,c=map(int,input().split())
amari=[]
for i in range(0,b):
  if (a*i)%b==c:
    print("YES")
    break
  if (a*i)%b!=c and i==b-1:
    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())

flag = True
for i in range(1, b+1):
    if (a * i) % b == c:
        print('YES')
        flag = False
        break
if flag:
    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')
        break
else:
    print('NO')

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

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

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

l = list(map(lambda x:x*a, range(b)))
for i in l:
    if i % b == c:
        ans = "YES"
        break

print(ans)

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

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

print("NO")

Solution (Python):
a, b, c = map(int, input().split())
cnt = 1
while b >= cnt:
    if (a*cnt) % b == c:
        print('YES')
        exit()
    
    cnt += 1
print('NO')

Solution (Python):
a,b,c=map(int,input().split())
i=0
A=[]
while True:
    i+=1
    if c==a*i%b:
        print("YES")
        break
    elif a*i%b in A:
        print("NO")
        break
    A.append(a*i%b)

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


import sys

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

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

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

Solution (Python):
a,b,c=map(int,input().split())
s=[a*i for i in range(1,b+1) if (a*i)%b==c]
print('YES' if len(s)>0 else '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())
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())

for i in range(A, A * B + 1, A):
    if i % B == C:
        flg = True
        break
    else:
        flg = False

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

Solution (Python):
a,b,c=map(int,input().split())
amari=[]
tmp=a
while(True):
    if a%b==c:
        print("YES")
        break
    elif a%b in amari:
        print("NO")
        break
    else:
        amari.append(a%b)
        a+=tmp

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())
print("YES" if any((a * i) % b == c for i in range(1, b+1)) else "NO")

Solution (Python):
x,y,z=map(int,input().split())
def lcd(a,b):
    if b==0: return 1
    else: return lcd(a%b,a)
def gcm(a,b):
    return a//lcd(a,b)*b
m=gcm(x,y)//x
ans=False
for i in range(m):
    if i*x % y==z:
        ans=True
        break
    else:continue
print(["NO","YES"][ans])

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

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

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

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

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

remain = [0]

for i in range(1,b):
  remain.append(a * i % b)
  
if c in remain:
  print("YES")
else:
  print("NO")

Solution (Python):
a, b, c = [int(x) for x in input().split()]
for i in range(1, 101):
    if a * i % b == c:
        print('YES')
        break
else:
    print('NO')

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

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

Solution (Python):
import fractions

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

if a % b == 0 or b <= c:
    print('NO')
else:
    r = a % b
    d = fractions.gcd(r, b)
    if d == 1:
        print('YES')
    elif c % d == 0:
        print('YES')
    else:
        print('NO')

Solution (Python):




"""def kiri(n,m):
  r_ = n / m
  if (r_ - (n // m)) > 0:
    return (n//m) + 1
  else:
    return (n//m)"""








def main():
  a,b,c = map(int,input().split())
  dic = {}
  ans = 0
  i = 1
  while True:
    ans += a
    a_m = ans % b
    if ans % b == c:
      print('YES')
      exit()
    if not str(a_m) in dic.keys():
      dic[str(a_m)] = 1
    else:
      
      print('NO')
      exit()
    i +=1
  
  
if __name__ == '__main__':
  main()

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

amari1 = a%b

flg = False
for i in range(b):
  if amari1*(i+1)%b == c:
    flg = True
    
if flg:
  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(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(2*B):
  if ((i*A)%B)==C:
    print("YES")
    break
else:
  print("NO")

Solution (Python):
import sys

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

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

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

Solution (Python):
a, b, c = map(int, input().split())
from fractions import gcd
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, B+1):
    if (A * i) % B == C:
        print("YES")
        break
else:
    print("NO")

Solution (Python):
a,b,c = map(int, input().split())
for i in range(b):
    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+1)%b==c:
        ans = 'YES'
print(ans)

Solution (Python):
a, b, c = map(int, input().split())
rem = a % b
tmp = 0
fa = a
ans = "NO"
if(rem!=0):
    while (tmp != rem):
        a += fa
        tmp = a % b
        if (tmp == c):
            ans = "YES"
            break
else:
    if(c==0):
        ans = "YES"
print(ans)

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

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

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

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

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

for i in range(10000):
    lis.append(a*i%b)
if c in lis:
    print('YES')
else:
    print('NO')

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

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

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

memo = 0
mods = []
i = 1
while True:
    memo = memo + A
    r = memo % B
    if r == C:
        flag = True
        break
    elif r in mods:
        flag = False
        break
    else :
        mods.append(r)
        i += 1
        
if flag:
    print('YES')
else :
    print('NO')

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

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

mod = a % b
is_ok = False
for i in range(b):
    if mod == c:
        is_ok = True
    mod = (mod+a) % b

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

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

Solution (Python):

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

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

Solution (Python):
A, B, C = map(int, input().split())
li=[]
for i in range(1000000):
  c=A*(i+1)%B
  if c  in li:
    break
  li.append(c)

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

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

l=[(a*i)%b for i in range(1,b+1)]

if l.count(c)>=1:
    print("YES")
else:
    print("NO")

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

exist = False
for i in range(1,b+1):

    if i*a % b == c:
        exist = True

if exist:
    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):
A,B,C = map(int,input().split(" "))
Amod = A%B

if Amod==0:
    if C!=0:
        print("NO")
    else:
        print("YES")
else:
    i=0
    while(i<=B):
        i+=1
        c = (i%B * Amod)
        if (c%B==C):
            print("YES")
            break
    if(i>B):
        print("NO")