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 = map(int, input().split())
mod = a % b
n = 1
flag = False
for n in range(mod * b):
  if (mod * n) % b == c:
    flag = True
    break

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

Solution (Python):

import sys


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

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

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

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

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

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

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

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

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

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

Solution (Python):
a, b, c = map(int,input().split())
sums = 0
for i in range(1,100):
  sums += a*i
  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):

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

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

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

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

Solution (Python):
a, b, c = map(int, input().split())
amaris = set()
index = 0
while True:
    amari = a * index % b
    if amari == c:
        print('YES')
        break
    elif amari in amaris:
        print('NO')
        break
    else:
        amaris.add(amari)
    index += 1

Solution (Python):


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

x = 0

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

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

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

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


if __name__ == "__main__":
    test()

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

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

extra = []
x = 1

while True:
    e = a * x % b
    if e in extra:
        break
    else:
        extra.append(e)
    
    x += 1
    
success = False
for e in extra:
    if e == c:
        success = True
        print('YES')
        break
        
if not success:
    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())

d=a
l=[]
for _ in range(b):
    l.append(a%b)
    a+=d
if c in l:
    print('YES')
else:
    print('NO')

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

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

m=A%B
n=0
cnt=False

for i in range(B):
    if (m*i-C)%B==0:
        cnt=True
        break

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

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

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

Solution (Python):


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

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

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

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

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

Solution (Python):
from collections import defaultdict

a, b, c = map(int, input().split())
d = defaultdict(int)
i = 1
tmp = a % b
while True:
    if d[tmp] > 0:
        break
    d[tmp] = 1
    i += 1
    tmp = (a * i) % b

dd = [0 for _ in range(250)]
dd[0] = 1
for i in range(c + 1):
    for key, value in d.items():
        dd[i + key] = max(dd[i], dd[i + key])


if dd[c] > 0:
    print("YES")
else:
    print("NO")

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

Solution (Python):


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

if __name__ == "__main__":
    resolve()

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

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

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

if f == True:
    print("YES")
else:
    print("NO")

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

if f == True:
    print("YES")
else:
    print("NO")

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

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

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

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

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

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

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

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

Solution (Python):
A,B,C = map(int, input().strip().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()]

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

if no_flg:
    print('NO')

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

ans = 'NO'
if a%b == c:
  ans = 'YES'
else:
  i = 2
  while i*a % b != a%b:
    if i*a % b == c:
      ans = 'YES'
      break
    i += 1
print(ans)

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

ans = 'NO'

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

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

flg = 0
i = 1


while 1:
    if i > 100:
        flg = 1
        break
    if (i*a)%b == c:
        flg == 0
        break
    i+=1

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

Solution (Python):
A, B, C = map(int, input().split())
r = R = A % B
for _ in range(B):
    if r == C:
        print("YES")
        exit()
    r = (r + R) % B
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')
    exit()
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')
        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)
L2 = list(set(L))
for i in range(len(L2)):
  for k in range(len(L2)):
    if L2[i]+L2[k] == c:
      print("YES")
      quit()
print("NO")

Solution (Python):
import sys
nums, divide, mod = map(int,input().split())

for i in range(divide):
    if (nums * i) % divide == mod:
        print("YES")
        sys.exit()
print("NO")

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

Solution (Python):
A, B, C = map(int, input().split())
a = A
if A % B == C:
    print ('YES')
    exit()

while A % B != 0:
    if A % B == C:
        print ('YES')
        exit()
    else:
        A += a
print ('NO')

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

k=0
x="NO"
for i in range(b):
    k=(k+a)%b
    if k==c:
        x="YES"
        break
print(x)

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())
d = a % b
for i in range(2,101):
  cur = a * i % b
  if cur == c:
    print('YES')
    break
  elif cur == d:
    print('NO')
    break

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())

D = 1
for i in [2, 3, 5, 7]:
    while A % i == 0 and B % i == 0:
        A = A // i
        B = B // i
        D = D * i
print('YES') if C % D == 0 else print('NO')

Solution (Python):
A, B, C = map(int, input().split())
a, b = sorted([A, B])
while a > 0:
  a, b = b%a, a
gcd = b
if C%gcd == 0:
  print("YES")
else:
  print("NO")

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

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

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

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

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

ans = False
for m in range(B):
  if m*A%B==C:
    ans = True
    break
print('YES' if ans else 'NO')

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

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

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

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

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

if flg==0:
    print("NO")

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

def cond(a, b, c):
    if a == 1:
        return True
    candidate = []
    i = 1
    while True:
        r = (a * i) % b
        if r in candidate:
            break
        i += 1
        candidate.append(r)
    if c in candidate:
        return True
    return False

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

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

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

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

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

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

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())
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())
d = a % b
li = [d % b]
i = 2
while True:
    e = (d * i) % b
    if e != (d % b):
        li.append(e)
    else:
        break
    i += 1
if c in li:
    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'

print(ans)

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




remain_list = []
for i in range(1, B + 1):
  tmp = (i * A) % B
  if tmp in remain_list:
    break
  else:
    remain_list.append(tmp)
      
if C in remain_list:
  print("YES")
else:
  print("NO")

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



condition=0

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

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

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

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

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
if a%2==0 and b%2==0 and c%2!=0:
  print("NO")

else:
  for i in range(1,1000):
    x = a*i
    for j in range(1,1000):
      if x%b == c:
        count += 1
      else:
        continue
  if count==0:
    print("NO")
  else:
    print("YES")

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

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

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

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

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

Flag = 0

for i in range(B):
  Tmp = A * (i+1)
  Tmp2 = Tmp % B
  if Tmp2 == C:
    Flag=1
    break

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

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

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

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

Solution (Python):

import sys
INF = float("inf")

MOD = 5  


def yes():
    print("YES")  


def no():
    print("NO")  


def solve(A: int, B: int, C: int):
    tot = 0
    for _ in range(100):
        tot += A
        if tot % B == C:
            yes()
            return
    no()
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  
    B = int(next(tokens))  
    C = int(next(tokens))  
    solve(A, B, C)


if __name__ == '__main__':
    main()

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

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

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

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

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):
  s = a*i
  if s%b == c:
    count+=1
    break
  else:
    pass

print("YES" if count>0 else "NO")

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

d = {}
cnt = 1
while True:
    m = (a * cnt) % b
    if m in d:
        print('NO')
        exit()
    if m == c:
        print('YES')
        exit()
    d[m] = True
    cnt += 1

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

Solution (Python):
A,B,C = map(int,input().split(' '))
L = [i*A for i in range(1,B+1)]

for j in L:
  if j % B == C:
    print('YES')
    exit()
print('NO')

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

n = 1
s = set()
while True:
  m = (n * a) % b
  if m == c:
    print('YES')
    exit()
  if m in s:
    print('NO')
    exit()
  s.add(m)
  n += 1

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

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

mod=a%b
i=mod
while check_list[i]==0:
  check_list[i]=1
  i+=mod
  i%=b
  if i==c:
    break
if i==c:
  print("YES")
else:
  print("NO")

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

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

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

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

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

Solution (Python):

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

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

print('NO')

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

Solution (Python):
a, b, c = 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())

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

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

def judge():
    for i in range(a):
        if (b*i+c)%a==0:
            return True
    return False

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

Solution (Python):
a,b,c = map(int,input().split())
big = a
sml = b
while sml > 0:
  big,sml = sml,big%sml
if c % big == 0:
  print('YES')
else:
  print('NO')

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

for i in range(0, A * B + 1, A):
    if i % B == C:
        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):
a, b, c = map(int, input().split())
ans = False

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

Solution (Python):

a, b, c = [int(el) for el in input().split(' ')]

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

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

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

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

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

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

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

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

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

print(ans)

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

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

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

print(ans)

Solution (Python):
a,b,c=map(int,input().split());print("YNEOS"[all(a*k%b!=c for k in range(b))::2])

Solution (Python):
a,b,c=map(int,input().split())
print("YNEOS"[all((a*k-c)%b for k in range(b))::2])

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

a,b,c=map(int,input().split(' '))
ans='NO'
for i in range(1,1000):
    n=a*i
    if n%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:
        print('YES')
        exit()
print('NO')

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

Solution (Python):

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

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

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

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

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

Solution (Python):
A,B,C=[int(x) for x in input().split()]
c=1
while (A*c)%B!=C:
  c+=1
  if (A*c)%B==A%B:
    print('NO')
    break
else:
  print('YES')

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


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

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

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

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

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

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

ok = False
for x in range(200):
  if (A * x) % B == C:
    ok = True
    
if ok:
  print("YES")
else:
  print("NO")

Solution (Python):

import sys, math, fractions, itertools

MOD = 5  
YES = "YES"  
NO = "NO"  

def solve(A: int, B: int, C: int):
    flag = False
    for i in range(B):
        if i * A % B == C:
            flag = True
    if flag:
        print('YES')
    else:
        print('NO')
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  
    B = int(next(tokens))  
    C = int(next(tokens))  
    solve(A, B, C)

if __name__ == '__main__':
    main()

Solution (Python):
def solve():
    a, b, c = read()
    result = think(a, b, c)
    write(result)


def read():
    return read_int(3)


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(a, b, c):
    m_seed = a % b
    while m_seed >= b:
        m_seed %= b

    visited = set()
    m_accumulated = m_seed
    while True:
        if m_accumulated == c:
            return True
        if m_accumulated in visited:
            return False
        visited.add(m_accumulated)
        m_accumulated += m_seed
        while m_accumulated >= b:
            m_accumulated %= b


def write(result):
    if result:
        print('YES')
    else:
        print('NO')


if __name__ == '__main__':
    solve()

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

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

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

Solution (Python):
x,y,z = map(int,input().split())
a = 1

for j in range(100):
    if((x*j) % y == z):
        print("YES")
        a = 0
        break

if(a == 1):
    print("NO")

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

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


main()

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


main()

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

cur_sum = 0
for _ in range(2 * B):
    cur_sum += A
    if (cur_sum % B == C):
        print("YES")
        exit(0)
print("NO")