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-----
7 5 1

-----Sample Output-----
YES

For example, if you select 7 and 14, the sum 21 is congruent to 1 modulo 5.

Difficulty: introductory

Starter code:

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

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

def answer(a: int, b: int, c: int) -> str:
    for i in range(1, b + 1):
        if a * i % b == c:
            return 'YES'
    return 'NO'


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


def __starting_point():
    main()
__starting_point()

A,B,C=map(int,input().split())
mod=set()
tmp=0
D=A
while tmp not in mod:
    mod.add(tmp)
    tmp=D%B
    if tmp==C:
        print('YES')
        return
    D+=A
print('NO')

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

if len([A for A in range(A,10000,A) if A%B==C]):
  print('YES')
else:
  print('NO')

a, b, c = map(int, input().split())
s = "NO"
for i in [a * j for j in range(1, b)]:
    if i % b == c:
        s = "YES"
        break

print(s)

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

a, b, c = map(int, input().split())
res = "NO"
for i in range(1, b+1): #bで割る=余りがb個の種類出る
    if (a*i)%b == c:
        res = "YES"
        break
print(res)

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

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


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

a, b, c = map(int, input().split())
for i in range(1, b+1): #bで割る=余りがb個の種類出る
    if (a*i)%b == c:
        print("YES")
        return
print("NO")

import sys
import copy
import math
import itertools
import numpy as np

A,B,C = [int(c) for c in input().split()]
a = []
cnt=0
while True:
    cnt+=A
    a.append(cnt%B)
    if C == cnt%B:
        print("YES")
        return
    elif a.count(cnt%B) >1:
        print("NO")
        return

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




import math
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")

a, b, c = list(map(int, input().split()))
count = 0
#aに１～bの数をかけたリスト
for i in range(b + 1):
    if ((i * a) % b) == c:
      print("YES")
      count += 1
      break
    else:
      pass

if count == 0:
  print("NO")
else:
  pass


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

a,b,c = map(int,input().split())
i = 0
flag = True
while flag:
  num = b * i
  if (num + c) % a == 0:
    print("YES")
    flag = False
  elif i >= 10**5:
    print("NO")
    break
  else:
    i += 1

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

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)

import sys
a,b,c=map(int,input().split())
i=1
l=[]
while True:
    aa=a*i%b
    if aa in l:
        break
    l.append(aa)
    i+=1
    if aa!=0 and c%aa==0:
        print('YES')
        return
print('NO')

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

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

else:
  mod_list = []
  for i in range(b):
    mod = (i*ganma)%b
    mod_list.append(mod)

  zero_one_list = []
  for i in range(b):
    if mod_list[i] == c:
      zero_one_list.append(1)
    else:
      zero_one_list.append(0)
    
  sum_list = sum(zero_one_list)

  if sum_list >= 1:
    print("YES")
  else:
    print("NO")

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


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

ans = 'NO'
for i in range(1, b+1):
  mod = (a*i) % b
  if mod == c:
    ans = 'YES'
    break
  elif mod in hist:
    break
  hist.append(mod)
    
print(ans)

import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: list(map(int, sys.stdin.readline().split()))
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

a, b, c = rm()
len_ = 1
s = set()
s.add(a)
i = a
while len_ == len(s):
    i += a
    i %= b
    len_ += 1
    s.add(i)
for i in list(s):
    if i == c:
        print('YES')
        return
else:
    print('NO')













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


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

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

print(result)

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


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

x = copy.deepcopy(a)
visited = [False] * (b+1)
flg = True
while True:
    x %= b
    if x == c:
        break
    elif visited[x]:
        flg = False
        break
    else:
        visited[x] = True
        x += a
print('YES') if flg else print('NO')

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

#ABC060 B:Choose Integers

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

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

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

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

# -*- coding: utf-8 -*-

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

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

print(ans)

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

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

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

    for i in range(1000000):
        m = a * i % b
        if m == c:
            print('YES')
            return
    print('NO')
__starting_point()

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

import re
import copy

def accept_input():
    a,b,c = list(map(int,input().split()))
    return a,b,c

a,b,c = accept_input()
aamari = a%b
amaridict = {}
curamari = a%b
for i in range(b):
    curamari = (curamari+aamari)%b
    amaridict[curamari] = 1
if c in amaridict:
    print("YES")
else:
    print("NO")


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

# -*- coding: utf-8 -*-
import numpy as np
import sys
from collections import deque
from collections import defaultdict
import heapq
import collections
import itertools
import bisect
from scipy.special import comb
import copy
sys.setrecursionlimit(10**6)


def zz():
    return list(map(int, sys.stdin.readline().split()))


def z():
    return int(sys.stdin.readline())


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


def C(line):
    return [sys.stdin.readline() for _ in range(line)]


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


a, b, c = map(int,input().split())
A = []
for i in range(1,b+1):
    mod = a*i % b
    if mod in A:break
    A.append(mod)

A.sort()
if len(A) >= 2:
    i = A[1]
else:
    i = 0

if i == 0 and c == 0:
    print('YES')
    return
elif i == 0 and c != 0:
    print('NO')
    return

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

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

for i in range(100):
  if ((C+B*i)/A).is_integer():
    print('YES')
    return
print('NO')

import math

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

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


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

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

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

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




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

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

aa = a
s = a % b
data = []

while True:
  aa += a
  data.append(aa % b)
  if aa % b == s:
    break
    
data.sort()

if a % b == 0:
  print("NO")
elif c % data[1] != 0:
  print("NO")
else:
  print("YES")


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

from math import gcd
numbers = list(map(lambda x: int(x), input().split()))
a, b, c = numbers[0], numbers[1], numbers[2]
print('YES') if not c % gcd(a, b) else print('NO')


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)

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

flag = True

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

A, B, C = list(map(int, input().split()))
#kA%Bの数列になる
#AをBで割ったあまりはB-1以下になる
#(k+B)A%B = (kA+BA)%B = kA%B + BA%B = kA%B
for i in range(1, B+1):
    if A*i%B == C:
        print('YES')
        return
print('NO')


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

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)

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

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

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


A,B,C = map(int,input().split())
dp = [0]*1000

ans = 'NO'
cur_A = A
while 1:
    if cur_A % B == C:
        ans = 'YES'
        break
    elif dp[cur_A%B] == 1:
        ans = 'NO'
        break
    dp[cur_A % B] = 1
    cur_A += A
print(ans)

a, b, c = map(int, input().split())
ans = 'NO'
for num in range(1, b + 1):
    if (num * a) % b == c:
        ans = 'YES'
        break
    else:
        pass
print(ans)

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

def gcd(x,y):
  while y != 0:
    x, y = y, x % y
  return x

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

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)

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

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

print('NO')

A, B , C = map(int, input().split())
def gcd(a, b):
	while b:
		a, b = b, a%b
	return a

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

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

print(answer())

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

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


from sys import stdin, stdout # only need for big input

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

def main():
    solve()


def __starting_point():
    main()
__starting_point()

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

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

a,b,c = zz()
ans = 0
for i in range(1,b+1):
   if (a*i)%b == c:
       ans = 1
       break

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


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

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

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)

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

ans = 'NO'
a, b, c = map(int, input().split())
memo = []
for i in range(1, 10**9):
  tmp = (a * i)%b
  if tmp == c:
    ans = 'YES'
    break
  if tmp in memo:
    break
  else:
    memo.append(tmp)
print(ans)

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

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

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

found = False
for n in range(1,101):
  if n*A % B == R:
    found = True
    break
    
if found:
  print("YES")
else:
  print("NO")


# -*- coding: utf-8 -*-

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

mod = []
for i in range(max(B,C)):
    res = A * i % B
    if res == C:
        ans = "YES"
        break
    if res in mod:
        ans = "NO"
        break
    mod.append(res)

print(ans)

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

n = a
cnt = 1
while cnt <= b:
    if n % b == c:
        print('YES')
        return
    cnt += 1
    n += a
print('NO')

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

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

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

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

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

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


lst = input().split()

A = int(lst[0])
B = int(lst[1])
C = int(lst[2])

L = []

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

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

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

for i in range(1,b+1):
    mod = a*i % b
    if mod == 0:continue
    elif c % mod == 0:
        ans = 'YES'
        break

print(ans)

a,b,c = map(int,input().split())
modb = [0]*100
for i in range(1,100000):
    n = a*i
    m = n%b
    # print(n,m)
    if(modb[m] != 0):
        break
    modb[m] = 1

print("YES" if(modb[c] == 1) else "NO")

#9 B - Choose Integers AC(hint)
A,B,C = map(int,input().split())

result = 'NO'

num = 0
#(k+B)A%B = (kA + AB)%B = kB
for i in range(1,B+1):
    num = (A*i)%B
    if num == C:
        result = 'YES'
        break
print(result)    

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

for i in range(b):
    if (a * i) % b == c:
        print('YES')
        break
    elif (a * i) % b == 0 and i > 0:
        print('NO')
        break

import sys, math
from itertools import combinations as c, product as p
from collections import deque
sys.setrecursionlimit(10**9)
INF = float('inf')
MOD = 10**9 + 7
#MOD = 998244353


def si(): return input()
def ii(): return int(input())
def fi(): return float(input())
def lstr(): return input().split()
def lint(): return list(map(int, input().split()))
def lintdec(): return list(map(lambda x:int(x) - 1, input().split()))
def lnstr(n): return [input() for _ in range(n)]
def lnint(n): return [int(input()) for _ in range(n)]
def lint_list(n): return [lint() for _ in range(n)]



############################################################
A, B, C = lint()

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

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)

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

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

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

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

for i in range(1000):
    calc += A
    rem = calc % B
    if rem == C:
        print('YES')
        return

print('NO')


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

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

A, B, C=map(int, input().split(" "))
candidate=[(A*i)%B for i in range(1, B-1)]

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

A, B, C=map(int, input().split(" "))
mod=[]
pivot=1
step=1

while True:
  pivot = (step*A)%B
  if (step*A)%B==C:
    print('YES')
    #print('debug', step)
    break
  elif pivot in mod:
    print('NO')
    break
  else:
    mod.append(pivot)
    step=step+1

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

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

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

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

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

# ?
# どうやって全探索するのかわからん
a, b, c = map(int, input().split())
for i in range(1, 1000):
    if (a * i) % b == c:
        print("YES")
        return
print("NO")