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):
A, B, C = [int(_) for _ in input().split()]

a_0 = A % B
a_log = set()

a = a_0
while True:
    if a == C:
        print("YES")
        break
    else:
        if a in a_log:
            print("NO")
            break
        else:
            a_log.add(a)
            a = (a + a_0) % B

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

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

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

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

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

while(True):
    if(sum%B==C):
        print("YES")
        break
    elif(sum>A*100):
        print("NO")
        break
    else:
        sum += A

Solution (Python):
A, B, C = map(int,input().split())
sum = 0
while True:
  if sum%B == C:
    print("YES")
    break
  elif sum > A*1000:
    print("NO")
    break
  else:
    sum += A

Solution (Python):


"""
Choose Integers
"""

test = False


def answer():
    """
    Aの倍数の中に条件を満たすものがあるか調べる。
    """
    A, B, C = map(int, input().split())

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


def main():
    """
    main関数
    """
    print(answer())


if __name__ == '__main__':
    main()

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

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

i = 1
ans = "NO"
while True:
    t = (A*i) % B
    if t in r:
        break
    else:
        if t == C:
            ans = "YES"
            break
        else:
            i += 1
            r.add(t)
print(ans)

Solution (Python):

import sys

def main():
	a, b, c = map(int, input().split(" "))
	
	i = 1
	tmp = []
	while True:
		ans = (i * a) % b
		if ans == c:
			print("YES")
			sys.exit()
		i += 1
		
		if ans in tmp:
			print("NO")
			sys.exit()
		tmp.append(ans)
	
if __name__ == "__main__":
	main()

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

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

print('NO')

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

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

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

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

Solution (Python):
A, B, C = map(int, input().split())
ans = 'NO'
loop = True
cnt = 1
remainder = (B+C)%A
while loop:
    if ((B*cnt)+C)%A == 0:
        ans = 'YES'
        loop = False
    elif (remainder == (((B*cnt)+C)%A)) and (1 < cnt):
        loop = False
    cnt += 1
print(ans)

Solution (Python):
a,b,c=map(int,input().split())
d=b
n=0
while 1:
    if (b+c)%a==0:
        print("YES")
        break
    elif n>10000:
        print("NO")
        break
    n+=1
    b+=d

Solution (Python):

"""
Created on Thu Mar  7 01:40:39 2019

@author: yuta
"""

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

def main(a,b,c):
    rest = []
    rest.append(a % b) 
    if rest[0] == c:
        print("YES")
    num = 2
    count = 0
    while ((a*num) % b) != rest[0]:
        rest.append((a*num) % b)
        if (a*num) % b == c:
            count += 1
            break
        else:
            num += 1
    if count == 1:
        print("YES")
    else:
        print("NO")
main(A,B,C)

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

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())
judge = 0

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

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

Solution (Python):
A, B, C = map(int, input().split())
i = 1
rec = []
while True:
  hoge = (A * i - C) % B
  if hoge == 0:
    print('YES')
    exit()
  i += 1
  if hoge in rec:
    print('NO')
    exit()
  else:
    rec.append(hoge)

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

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

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

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

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

Solution (Python):
from itertools import product

a, b, c = list(map(int, input().split()))
aset = {(a * i) % b for i in range(0, b)}

TheNumberOfElementsIn_aset = 0

while TheNumberOfElementsIn_aset != len(aset):
    TheNumberOfElementsIn_aset = len(aset)
    for element1, element2 in product(aset, aset):
        aset.add((element1 + element2) % b)


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

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

for i in range(2, B+1):
    nums.append((A*i)%B)

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

Solution (Python):
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools
import copy

def j(q):
    if q==1: print("YES")
    else:print("NO")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())




a,b,c = (int(i) for i in input().split())    









d = a
for i in range(100):
    if a%b == c:j(1)
    a+=d
j(0)

Solution (Python):

A, B, C = map(int, input().split())
mod = [A % B]
i = 1
while True:
    i += 1
    if mod[0] * i % B not in mod:
        mod.append(mod[0] * i % B)
    else:
        break
print(['NO', 'YES'][C in mod])

Solution (Python):
a,b,c=map(int,input().split())
k=a
for i in range(b):
    if k%b==c:
        print("YES")
        break
    else:
        k+=a
if k==a*(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')
		break
	if i==b:
		print('NO')

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


main()

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

a, b, c = [int(i) for i in input().split()]
d=gcd(a,b)
if c % d == 0:
  print("YES")
else:
  print("NO")

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

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

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

for i in range(100000):
    if (B*i+C)%A == 0:
        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:
        flg = True
        break
    else:
        flg = False

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

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

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

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

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

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

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

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

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

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

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

Solution (Python):
A,B,C = map(int,input().split())
def gcd (x,y):
    X = max(x,y)
    Y = min(x,y)
    if Y == 0:
        return X
    else:
        return gcd(Y,X%Y)

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

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

ab = gcd(a, b)

if c % ab == 0:
    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):
def gcd(x,y):
  if y==0:
    return x
  else:
    return gcd(y,x%y)
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())
flag =False
for i in range(1,b+1):
  if (a*i)%b ==c:
    flag =True
if flag:
  print("YES")
else:
  print("NO")

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

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

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

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

A, B, C = [int(x) for x in 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(A, A * B + 1):
    if i % A == 0 and i % B == C:
        flg = True
        break
    else:
        flg = False

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

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

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

Solution (Python):
list=input()
list=list.split()
list=[int(i) for i in list]
A=list[0]
B=list[1]
C=list[2]
Sum=A
flag=True
rem=A%B
while Sum%B!=C:
    Sum+=A
    if Sum%B==rem:
        flag=False
        break
if flag:
    print('YES')
else:
    print('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 s in range(1,100):
  if a*s%b==c:
    print("YES")
    exit()
print("NO")

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

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

Solution (Python):
A, B, C = map(int, input().split())
opened = []
x = 1
while True:

    if (A * x) % B == C:
        print('YES')
        exit(0)
    else:
        if (A * x) % B in opened:
            print('NO')
            exit(0)
        opened.append((A * x) % B)
        x += 1

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

Solution (Python):
temp = input().rstrip().split(" ")
A = int(temp[0])
B = int(temp[1])
C = int(temp[2])
flag = 0
if A == B and C > 0:
    print("NO")
elif A == 1:
    print("YES")
elif A + C == B:
    print("YES")
else:
    for i in range(1,10000):
        if (A * i) % B == C:
            print("YES")
            flag = 1
            break
    if flag == 0:
        print("NO")

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

ok = 0

for i in range(1,b+1):
  if a * i % b == c:
    ok += 1
  else:
    ok += 0

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

Solution (Python):
from fractions import*;a,b,c=map(int,input().split());print('YNEOS'[c%gcd(a,b)>0::2])

Solution (Python):
from fractions import*;a,b,c=map(int,input().split());print('YNEOS'[c%gcd(a,b)>0::2])

Solution (Python):
a,b,c=map(int,input().split())
x=1
data=set()
now=0
while x==1:
    now+=a
    now%=b
    if now==c:
        print('YES')
        break
    if now in data:
        print('NO')
        break
    data|={now,}

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

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

Solution (Python):
def func():
    pass


def main():
    a, b, c = map(int, input().split())
    l = []
    i = 1
    while True:
        x = a * i
        left = x % b
        if left == c:
            print("YES")
            return
        if left in l:
            print("NO")
            return
        l.append(left)
        i += 1


if __name__ == '__main__':
    main()

Solution (Python):
a, b, c = map(int, input().split())
def gcd(x, y):
  while(y > 0):
    x, y = y, x % y
  return x
g = gcd(a, b)
if ((g == 1) | (c % g == 0)):
  print('YES')
else:
  print('NO')

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

ans = 'NO'
from fractions import gcd
for i in range(a, a * b // gcd(a, b), a):
    if 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 (a * i) % b == c:
        ans = 'YES'
        break
    else:
        ans = 'NO'
print(ans)

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

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

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


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

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

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

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

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):
import sys

sys.setrecursionlimit(200000)


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


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


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


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

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

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

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

Solution (Python):


import math
def getInt(): return int(input())
def getIntList(): return [int(x) for x in input().split()]
def getIntFromRows(n): return [int(input()) for i in range(n)]
def getIntMat(n):
    mat = []
    for i in range(n): mat.append(getIntList())
    return mat

def zeros(n): return [0 for i in range(n)]
def zeros2(n, m): return [[0 for i in range(m)] for j in range(n)]
N1097 = 10**9 + 7 

debug = True
def db(x): 
    if debug: print(x)
debug = False

a,b,c = getIntList()
rm = a % b
rslt = 'NO'
for i in range(b+1):
    if a%b==c:
        rslt = 'YES'
        break
    a += rm
db(a)
print(rslt)

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

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

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

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

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

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

def check(A, B, C):
    return any((i * B + C) % A == 0 for i in range(A))

if check(A, B, C):
    print("YES")
else:
    print("NO")

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

def check(A, B, C):
    for i in range(A):
        x = i * B + C
        if x % A == 0:
            return True
    return False

if check(A, B, C):
    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())
i = 1
while i <= B :
    if (i * A ) % B == C :
        break
    i = i + 1
if i == B + 1 :
    print("NO")
else :
    print("YES")

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

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 (i*a) % b == c:
        print("YES")
        exit()
print("NO")

Solution (Python):
A,B,C=map(int,input().split())
res=False
for i in range(B):
    if (A*i)%B==C:
        res=True
if res==True:
    print("YES")
else:
    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):
int_a, int_b, int_c = map(int, input().split())

for i in range(1,int_b + 1):
    if int_a * i % int_b == int_c:
        print("YES")
        exit(0)
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):
def abc060_b():
    a, b, c = map(int, input().split())
    for i in range(1, 101):
        if a * i % b == c:
            print("YES")
            return None
    print("NO")


abc060_b()

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 = [int(i) for i in 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())
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())
count=0
for i in range(1000):
    if((a%b)*i%b==c):
        print("YES")
        count=1
        break
if(count==0):
    print("NO")

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

mod = []
a = A
i = 1
while a*i % B not in mod:
    mod.append(a*i % B)
    i += 1


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

Solution (Python):
s=input().split();a=int(s[0]);b=int(s[1]);c=int(s[2]);pd=0
for i in range(0,1000):
    if a*i%b==c:
        print('YES')
        pd=1
        break
if pd==0:
    print('NO')

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

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

print(ans)

Solution (Python):
a,b,c=map(int,input().split())
for i in range(10**6):
    if (i*b+c)%a==0:
        print("YES")
        exit()
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):
import fractions

A, B, C = map(int, input().split())
ab = fractions.gcd(A, B)
if C % ab == 0:
    print("YES")
else:
    print("NO")

Solution (Python):
import fractions

A, B, C = map(int, input().split())
ab = fractions.gcd(A, B)
temp = fractions.gcd(A, ab)
if C % temp == 0:
    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
        break
if flag:
    print("YES")
else:
    print("NO")

Solution (Python):



def main():
    """Function."""
    a, b, c = map(int, input().split())

    check = set()
    temp = a
    flag = 0
    while temp % b not in check:
        if c in check:
            flag = 1
            break
        else:
            check.add(temp % b)
            temp = temp + a

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


if __name__ == "__main__":
    main()

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

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

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


if __name__ == '__main__':
    main()

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


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

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


def find_loop(x, mod):
    remainders = [x % mod]
    i = 1
    while True:
        i += 1
        r = (a * i) % b
        if r not in remainders:
            remainders.append(r)
        else:
            break
    return remainders


def judge(reminders, mod, c):
    result = [0]
    for rs in reminders:
        result = list({(x+r)%mod for x in result for r in rs})
    if c in result:
        return True
    return False


reminders = [find_loop(r, b) for r in find_loop(a, b)]
print('YES') if judge(reminders, b, c) else print('NO')

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

Solution (Python):
A, B, C = [int(i) for i 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 = [int(i) for i in input().split()]






msg = "NO"
for a in range(1,100) :
    if ((a*A) % B ==C ):
        msg = "YES"
        break

print(msg)

Solution (Python):
A, B, C = [int(i) for i in 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())
A_ = A
counter = 0
while True:
    if A_%B == C:
        print("YES")
        break
    A_ += A
    counter += 1
    if counter > B:
        print("NO")
        break

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

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

else:
    print('NO')
    exit()

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

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

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,input().strip().split(" "))

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

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())
i=0
l=[]
while True:
  i+=1
  m=(a*i-c)%b
  if m==0:
    print('YES')
    exit()
  if l.count(m):
    print('NO')
    exit()
  else:
    l.append(m)

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


def gcd(x, y):
    if x < y:
        return gcd(y, x)
    elif x % y == 0:
        return y
    else:
        return gcd(y, x % y)


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

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

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

P = max(A, B)
Q = min(A, B)
R = P % Q
while(R != 0):
    P = Q
    Q = R
    R = P % Q

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

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

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

Solution (Python):
a, b, c = map(int, input().split())
def gcd(x,y):
    p = max(x,y)
    q = min(x,y)
    while p % q != 0:
        r = p % q
        p = q
        q = r
    c = q
    return q
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):
    tmp = a * i % b
    if tmp == c:
        print('YES')
        exit()

print('NO')

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

for k in range(1,B+1):
  if k*A % B == C:
    print('YES')
    exit()

print('NO')

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

Solution (Python):
def GCD(x, y):
    while(y != 0):
        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):

import sys
a,b,c = (int(_) for _ in input().split())

m = []
n = 0
while(True):
    t = (a*n)%b
    if(t in m):
        print('NO')
        sys.exit()
    else:
        m.append(t)
    if(t == c):
        print('YES')
        sys.exit()
    n += 1

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())
amari = list()
i = 1
while True:
    save = (a * i ) % b
    if save in amari:
        break
    amari.append(save)
    i += 1
    
if c in amari:
    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 = (int(i) for i in input().split())

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

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

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

result = 'NO'
n = 1
f = A * n % B
m = f
while m != C:
    if 1 < n and m == f:
        break

    n += 1
    m = A * n % B


print('YES' if m == C else 'NO')

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

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

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

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

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

print('NO')

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

Solution (Python):
def gcd(a,b):
    if b==0:return a
    else:return gcd(b, a%b)
a,b,c=map(int,input().split())
print('YNEOS'[c%gcd(a,-b)!=0::2])

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())
flag = False

for i in range(b):
  if i * a % b == c:
    flag = True
  else:
    pass

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

Solution (Python):
def gcd(m, n):
  if n == 0:
    return m
  
  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 = list(map(int,input().split(" ")))
i = a[0]
count = 0
while i <= 10000:
    if i % a[1] == a[2]:
        count += 1
        break
    i += a[0]
if count >= 1:
    print("YES")
else:
    print("NO")

Solution (Python):
a, b, c = [int(s) for s in input().rstrip().split()]
judge = False
for m in range(1, b+1):
    if m * a % b == c:
        judge = True
ans = 'YES' if judge else 'NO'
print(ans)

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())
ini=A%B
tmp=ini
while(1):
  if(tmp==C):
    print("YES")
    break
  else:
    tmp+=ini
    tmp=tmp%B
    if(tmp==ini):
      print("NO")
      break

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

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

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):
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")