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):
def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x % y)


a, b, c = [int(x) for x in input().split()]
re = set()
for i in range(1, int(b / gcd(a, b)) + 1):
    re.add(a * i % b)
print("YES") if c in re else print("NO")

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

Solution (Python):
k = map(int, raw_input().split())
temp = [k[0]]
for i in xrange(1000):
    if sum(temp) % k[1] == k[2]:
        print "YES"
        exit()
    temp.append(int(k[0]))

print "NO"

Solution (Python):


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

ok = False
for p in range(1, b + 1):
    if a * p % b == c:
        ok = True
print(("NO", "YES")[ok])

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

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

    rem = set()
    s = 0
    i = 1
    while True:
        s += A * i
        m = s % B
        if m == C:
            print("YES")
            break

        if m in rem:
            print("NO")
            break

        rem.add(m)

if __name__ == '__main__':
    main()

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


for i in range(1,10**5):
	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")
        break
else:
    print("NO")

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

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

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

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

def judge(a, b, c):
  for i in range(1, b * 10):
    if i * a % b == c:
      return 'YES'
  return 'NO'

print(judge(a, b, c))

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

flag = 1
for i in range(101):
    temp = a * i
    if(temp % b == c):
        print("YES")
        flag = 0
        break
if(flag):
    print("NO")

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

res = 0

sum = B + C
for i in range(100):
	sum += B
	if sum % A == 0:
		res = 1
		break

print('YES' if res == 1 else 'NO')

Solution (Python):
val = [int(x) for x in input().split()]

_sum = val[1] + val[2]
cnt = 0
res = 0

for i in range(0, 100):
    _sum += val[1]
    if _sum % val[0] == 0:
        res = 1
        break
print("YES" if res == 1 else "NO")

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

Solution (Python):
a, b, c = input().split()
a = int(a)
b = int(b)
c = int(c)
w = a
i = 0
while i < 100:
 if  a%b == c:
  print("YES")
  break
 else:
  a = a+w
  i = i+1
if i ==100:
 print("NO")
else:
 a = a

Solution (Python):
A, B, C = map(int, input().split())
i = 0
ans = 0
while i < B:
    if ans % B == C:
        print("YES")
        break
    ans += A
    i += 1
else:
    print("NO")

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

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

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

print ans

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

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

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

Solution (Python):
import fractions
A, B, C = [int(n) for n in input().split()]
if C % fractions.gcd(A, B) == 0:
  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 = map(int, input().split())
for i in range(A, A * B + 1, A):
    if i % B == C:
        print('YES')
        exit()
print('NO')

Solution (Python):
def solve(a, b):
    c = a % b
    if c == 0:
        return b
    else:
        return solve(b, c)


A, B, C = [int(i) for i in input().split()]
z = 0
num = abs(A - B)
if num == 0:
    print('NO')
    exit()
else:
    num = solve(B, num)
if C % num == 0:
    print('YES')
else:
    print('NO')

Solution (Python):
A, B, C = list(map(int, input().split()))
flag = False
for i in range(1, B+1):
    if (i*A)%B == C:
        flag = True
if flag:
    print('YES')
else:
    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())

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

Solution (Python):
a,b,c=map(int,input().split())
n=[]
for x in range(1,b+1):
    n.append(a*x)

for x,y in enumerate(n):
    if y%b==c:
        print("YES")
        break
else:
        print("NO")

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

Solution (Python):
a,b,c=[int(x) for x in input().split()]
import sys
for i in range(1,b+1):
    if a*i%b==c:
        print("YES")
        sys.exit()
print("NO")

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

    flag = 1
    comp = a
    while comp <= a*b:
        if comp%b == c:
            print("YES")
            flag = 0
            break
        comp += a

    if flag: print("NO")


if __name__ == "__main__":
    main()

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

X = False

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

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

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

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

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

Solution (Python):
A, B, C = map(int, input().split())
loop = int(5050 / A)
x = 0
for i in range(1, loop+1):
    if A * i % B == C:
        x += 1
    else:
        pass

if x > 0:
    print("YES")
else:
    print("NO")

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

Solution (Python):



import sys
import re
import math
import collections
import itertools
import functools

DEBUG = True
DEBUG = False

def dbg(*args):
    if DEBUG:
        print("DBG: ", file=sys.stderr, end="")
        print(*args, file=sys.stderr)



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

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

    print("NO")

if __name__ == "__main__": main()

Solution (Python):
from collections import defaultdict


def main():
    A, B, C = map(int, input().split())
    for i in range(1, 1000):
        if A * i % B == C:
            print("YES")
            return
    print("NO")



if __name__ == '__main__':
    main()

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

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

Solution (Python):
if __name__ == "__main__":
    A,B,C = map(int, input().split())
    res = set()
    a = A % B
    while (True):
        if a in res:
            break
        res.add(a)
        a += A % B
        a %= B
    if C in res:
        print ("YES")
    else:
        print ("NO")

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


for i in range(1, 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(100):
    if a * i % b == c:
        ans = "YES"
print(ans)

Solution (Python):

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

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

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

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

Solution (Python):
from fractions import gcd

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

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

Solution (Python):
import sys




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


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

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

Solution (Python):
import sys



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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
i = input().split()
a = int(i[0])
b = int(i[1])
c = int(i[2])

answer = "NO"
count = a

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

    
print(answer)

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

result = "NO"

for i in range(a, a*b+a, a):
    if i % b is c:
        result = "YES"
        break

print(result)

Solution (Python):

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


def lcm(a, b):
    return a * b // gcd(a, b)

if __name__ == "__main__":
    input_list = list(map(int, input().split()))
    a, b, c = input_list

    result = False
    lcm_of_ab = lcm(a, b)
    for i in range(lcm_of_ab // a + 1):
        if (not i):
            continue

        if (a * i) % b == c:
            result = True
            break

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

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

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

if __name__ == "__main__":
    solve()

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

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

flag = 0

for i in range(B):
    if(i==0):
        continue

    amari = (i * A) % B

    if(amari == C):
        flag = 1

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

Solution (Python):
def solve():
  ar = raw_input().split(' ')
  A = int(ar[0])
  B = int(ar[1])
  C = int(ar[2])

  s = set([])
  sum = 0
  while True:
    sum = sum + A
    m = sum % B
    
    if (m == C): return 'YES'
    if (m in s): return 'NO'
    s.add(m)

if __name__ == '__main__' :
  print solve()

Solution (Python):
from sys import stdin
a,b,c = map(int, stdin.readline().split())
ans = 'NO'
for i in xrange(1000):
 if (i*a)%b==c:
  ans = 'YES'
print ans

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

ans = "NO"

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

print(ans)

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

def remainderSet(divident, divisor):
    mul = 1
    r_set = set()
    for _ in range(divisor):
        r_set.add((mul * divident) % divisor)
        mul += 1
    return r_set

if c in remainderSet(a, b):
    print('YES')
else:
    print('NO')

Solution (Python):
input_str = input()
input = input_str.split(' ')
a = int(input[0])
b = int(input[1])
c = int(input[2])
flag = False
for n in range(100):
    if (n*a)%b == c:
        flag = True

if flag:
    output = 'YES'
else:
    output = 'NO'

print(output)

Solution (Python):




l = [int(x) for x in input().split(" ")]
A = l[0]
B = l[1]
C = l[2]

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

print("NO")

Solution (Python):
import sys

n, m, r = [int(x) for x in sys.stdin.readline().split()]
b = 0
for i in range(m):
	a = (n * (i + 1)) % m
	if a == r:
		b = 1
		break
if b == 1:
	print('YES')
else:
	print('NO')

Solution (Python):
A,B,C = map(int, input().split())
X = 0
for  k in range(B-1):
    if A * k % B == C:
         print('YES')
         X = 1
         break

if X == 0:
    print('NO')

Solution (Python):
n = input()
tmp_n = n.split(" ")

a = tmp_n[0]
b = tmp_n[1]
c = tmp_n[2]

flag=0

for i in range(0,100):
    check = int(b)*i+int(c)
    if check%int(a) == 0:
        flag = 1

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

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

Solution (Python):
a, b, c = map(int, input().split(' '))
modlist = []
result = ""
for i in range(1, b + 1):
    value = a * i
    if value % b == c:
        result = "YES"
        break
    if value % b not in modlist:
        modlist.append(value % b)
    else:
        result = "NO"
        break
print(result)

Solution (Python):
a, b, c = map(int,input().split(' '))
n = 1
mod = []
while(True):
    if (a * n) % b == c:
        print("YES")
        break
    else:
        if (a * n) % b not in mod:
            mod.append((a * n) % b)
        else:
            print("NO")
            break
    n += 1

Solution (Python):

a, b, c = map(int, raw_input().split())
check = 0
while check <= a:
    if (b * check + c) % a == 0:
        print "YES"
        exit()
    check += 1
print "NO"

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

Solution (Python):

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

a = int(a)
b = int(b)
c = int(c)

flag = False

for i in range(100):
    tmp = (a * i) % b
    if tmp == c:
        flag = True
        break

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

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

M = set()
now = A % B

while now not in M:
    M.add(now)
    now = (now + A) % B

used = [False] * B
stack = list(M)
while stack:
    x = stack.pop()
    if used[x]:
        continue
    if x == C:
        print("YES")
        break
    used[x] = True
    for m in M:
        if not used[(x + m) % B]:
            stack.append((x + m) % B)
else:
    print("NO")

Solution (Python):
a, b, c = [int(x) for x in input().split()]
 
def foo(a, b, c):
    for i in range(1, b+1):
        if (a*i)%b == c:
            return "YES"
    return "NO"
    
print(foo(a, b, c))

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

Solution (Python):
a,b,c = map(int, raw_input().split())
temp = a
for i in xrange(1, 101):
    if a % b == c:
        flag = 1
        break
    else:
        a = temp * i
        flag = 0
if flag == 1:
    print "YES"
else:
    print "NO"

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

Solution (Python):
a=map(int, raw_input().split())

time=a[0]
ans=0

while time%a[1]!=0:
  if time%a[1]==a[2]:
    ans=1
    break
  time+=a[0]

if ans==0:
  print "NO"
else:
  print "YES"

Solution (Python):

import sys
A, B, C = map(int, input().split())
for tmp in range(1, B+1):
    if A*tmp%B == C:
        print("YES")
        sys.exit()
    else:
        pass
print("NO")

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

Solution (Python):

a,b,c = [int(i) for i in input().split(" ")]
flag = False
amari = a % b
limit = b
for x in range(1,limit):
    if (amari * x) % b == c:
        flag = True
        break
if flag is True:
    print("YES")
else:
    print("NO")

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

while b > 0:
    d = a % b
    a = b
    b = d

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

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

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

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

    i = 1
    while i <= B:
        if A * i % B == C:
            print('YES')
            break
        i += 1
    else:
        print('NO')

main()

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

    i = 1
    while i <= 100:
        if A * i % B == C:
            print('YES')
            break
        i += 1
    else:
        print('NO')

main()

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

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

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

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

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

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

Solution (Python):
num = input()
num = num.split(" ")

for i in range(3):
    num[i] = int(num[i])

top = num[0] % num[1]

i = 1
n = ( i * num[0] ) % num[1]
while True:

    if n == num[2]:
        print("YES")
        break

    i +=1
    n = ( i * num[0] ) % num[1]

    if n == top:
        print("NO")
        break

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

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

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

Solution (Python):
a, b, c = input().split(' ')
a = int(a)
b = int(b)
c = int(c)
flag = 0
x = a%b
for i in range(1, 101):
    if (x*i)%b == c:
        flag=1
        break

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

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

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

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

D = A%B
flag=False
for i in range(B):
    if C==(D*i)%B:
        flag=True

if flag:
    print "YES"
else:
    print "NO"

Solution (Python):
a, b, c = map(int, input().split())
n = max(int(b / a), 1)
p = 'NO'
s = set()
r = n * a % b

while r not in s:
    if r == c:
        p = 'YES'
        break
    else:
        s.add(r)
        n += 1
        r = n * a % b
print(p)

Solution (Python):
a,b,c = [int(i) for i in input().split()]
arr = set()
ret = "NO"
r = a%b
if r==0:
    if c==0:
        ret="YES"
    else:
        pass
elif r==1:
    ret = "YES"
else:
    rr = r
    while not(rr in arr):
        
        if rr <= c and (c-rr)%r == 0:
            ret = "YES"
            break
        else:
            arr.add(rr)
            n = int((b-rr)/r)
            n += 1 if (b-rr)%r != 0 else 0
            rr = (n*r + rr)%b
            
print(ret)

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

Solution (Python):
a,b,c=map(int,input().split())
s=set()
n=1
while (a*n)%b not in s:
    s.add((a*n)%b)
    n += 1
print('YES' if c in s else 'NO')

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

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

check(A,B,C)

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

ans='NO'

i = 1
f = a % b
while(1):
    tmp = a * i
    mod = tmp % b

    if mod == c:
        ans = 'YES'
        break

    if i != 1 and mod == f:
        break

    i += 1


print(ans)

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

for i in range(b + 1):
    prov = a * i
    if prov % b == c:
        ans = "YES"
        break

print(ans)

Solution (Python):
def main():
    n = list(map(int, input().split()))
    l = [n[0]*i for i in range(1,n[1]+1) if (n[0]*i)%n[1] == n[2] ]
    if 0 < len(l):
        print("YES")
    else:
        print("NO")

main()

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

answer = "NO"
for i in range(b):
    d = i*a
    if d%b == c:
        answer = "YES"

print(answer)

Solution (Python):
number = list(input().split())

alist = []
for i in range(1,1000000000):
    mod = int(number[0]) * i % int(number[1])
    if mod == int(number[2]):
        print("YES")
        break
    if mod in alist:
        print("NO")
        break
    alist.append(mod)

Solution (Python):


if __name__ == "__main__":
    A, B, C = map(int, raw_input().split(" "))

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

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

Solution (Python):

A, B, C = map(int,raw_input().split())
ans = "NO"
for n in range(B):
    if (A*n)%B == C:
       ans = "YES"
print ans

Solution (Python):

A, B, C = map(int,raw_input().split())
flg = 0
for n in range(B):
    if (A*n)%B == C:
        flg = 1
        break
if flg == 1:
    print "YES"
else:
    print "NO"

Solution (Python):

a,b,c=map(int,raw_input().split())
res='NO'
for i in xrange(b+1):
 if (a*i)%b==c:
  res='YES'
print res

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()

def main():
    a,b,c = LI()
    for i in range(1,101):
        if a*i % b == c:
            return 'YES'

    return 'NO'


print(main())

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

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

Solution (Python):
if __name__ == "__main__":
    A, B, C = [int(i) for i in raw_input().split()]
    flags = [False]*B
    n = A % B
    while True:
        if flags[n] == True:
            print "NO"
            break
        flags[n] = True
        n = (n+A) % B
        if flags[C] == True:
            print "YES"
            break

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

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

b()

Solution (Python):
ABC = input().split()
A=int(ABC[0])
B=int(ABC[1])
C=int(ABC[2])


count = A*B


for index in range(count+1):
    if (A*index)%B==C:
        print("YES")
        break
    elif index ==count:
        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')
        quit()

print('NO')

Solution (Python):
a,b,c = map(int, input().split())
able = set()
u = a%b
able.add(u)
v = (u + u) % b
while v not in able:
    able.add(v)
    v = (v + u) % b

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

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

D=[]


for n in range(1, 10000):

    if((a * n) % b) == c:
        D.append("Y")   
        
if len(D)>0:
    print("YES")
else:
    print("NO")

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

amari = [False] * b

for i in range(1000):
    if (a * i) % b == c:
        print('YES')
        break
    elif amari[(a * i) % b]:
        print('NO')
        break

    amari[(a * i) % b] = True

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

i = 0

while (i < 1000):
	i += 1
	if (a * i) % b == c:
		print "YES"
		break

if i == 1000:
	print "NO"

Solution (Python):
import sys
import math

INF = 10**9+7

stdin = sys.stdin
def na(): return map(int, stdin.readline().split())
def ns(): return stdin.readline().strip()
def nsl(): return list(stdin.readline().strip())
def ni(): return int(stdin.readline())
def nil(): return list(map(int, stdin.readline().split()))

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

def lcm(a, b):
	return a * b // gcd(a, b)

a, b, c = nil()

ans = "NO"

if c % (b/(lcm(a, b)/a)) == 0:
    ans = "YES"

print(ans)

Solution (Python):
if __name__ == '__main__':
    abc = input().split()
    A = int(abc[0])
    B = int(abc[1])
    C = int(abc[2])
    a = A % B
    r = 0 
    for i in range(1, B):
        if a * i % B == C:
            r = 1
            break
    if 1 == r:
        print('YES')
    else:
        print('NO')

Solution (Python):
from fractions import gcd
nums = [int(x) for x in input().split()]

def ngcd(nums):
	d = 0
	for num in nums:
		d = gcd(d,num)
	return d


t = ngcd(nums)
if t != 1:
	nums = [int(num / t) for num in nums]

t = gcd(nums[0],nums[1])
if t == 1:
    print('YES')
else:
    print('NO')

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

b()

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


a=range(1000)

judge="NO"

for i in range(1000):
    a[i]=A*a[i]%B
    if (a[i]==C):
        judge="YES"

print(judge)

Solution (Python):
a = map(int, raw_input().split(" "))
A = a[0]
a[1]
a[2]
b = []

while True:
    B = A % a[1]
    if A >= a[1]:
        if (B == a[2]):
            print "YES"
            quit()

        if B in b:
            print "NO"
            quit()
        else:
            b.append(B)
    A += a[0]

Solution (Python):
import sys

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

for i in range(1, 101):
    if C == 0 and (B * i % A) == 0 or \
            (C % A) == 0 and (B * i % A) == 0 or \
            (B * i % A) != 0 and (C % A) % (B * i % A) == 0:
        print('YES')
        sys.exit()

print('NO')

Solution (Python):
import sys

def main():
    line = sys.stdin.readline()
    lst = line.split()
    a = int(lst[0])
    b = int(lst[1])
    c = int(lst[2])

    if a == 1:
        print("YES")
        return 0

    mod = a % b
    sys.stderr.write(str(mod) + "\n")
    mod_lst = [mod]
    tmp_num = a + a

    while True:
        mod = tmp_num % b
        if mod in mod_lst:
            
            
            
            break
        else:
            
            mod_lst.append(mod)
            tmp_num += a

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

    return 0

if __name__ == '__main__':
    sys.exit(main())

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

amari = []

for i in range(0, 10000000):
    d = a * i
    if d % b == c:
        print("YES")
        break

    else:
        if d % b not in amari:
            amari.append(d % b)
        else:
            print("NO")
            break

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

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

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

print(ans)

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

Solution (Python):
num = map(int, raw_input().split())
while(num[1] != 0):
	tmp = num[1]
	num[1] = num[0] % num[1]
	num[0] = tmp
if(num[2] % num[0] == 0):
	print("YES")
else:
	print("NO")