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

Solution (Python):
from sys import stdin


def main() -> int:
    ans = "NO"
    a = next_int()
    b, c = map(int, input().split())

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


def next_int() -> int:
    return int(next_str())


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


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

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

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

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

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

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



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

print('NO')

Solution (Python):
from fractions import gcd
a, b, c = map(int, raw_input().split())
print ['NO', 'YES'][c % gcd(a, b) is 0]

Solution (Python):
from fractions import gcd
a, b, c = map(int, raw_input().split())
print ['NO', 'YES'][c % gcd(a, b) is 0]

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

Solution (Python):
A, B, C = map(int, input().split())
lis = list(range(1, 100000))
AA =0
for i in lis:
    AA = A*i
    if AA%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):
def gcd(a, b):
	while b:
		a, b = b, a % b
	return a

abc_input = list(map(int, input().split()))
a = abc_input[0]
b = abc_input[1]
c = abc_input[2]

factor = gcd(a, b)

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

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

while True:
    amari = (modL[len(modL)-1]+a)%b
    if amari == c:
        print("YES")
        break
    elif amari in modL:
        print("NO")
        break
    else:
        modL.append(amari)

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

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

print("NO")

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

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

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

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

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

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

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

Solution (Python):
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


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


if __name__ == '__main__':
    main()

Solution (Python):
import sys
import math
import collections
import itertools
import array
import inspect


sys.setrecursionlimit(1000000)



def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))



def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v



def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk



def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False



dp = None


def main():
    A, B, C = li_input()

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


main()

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

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

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

Solution (Python):
import sys
stdin = sys.stdin

def li(): return [int(x) for x in stdin.readline().split()]
def li_(): return [int(x)-1 for x in stdin.readline().split()]
def lf(): return [float(x) for x in stdin.readline().split()]
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(ns())
def nf(): return float(ns())


def findGCD(a:int, b:int) -> int:
    
    while 1:
        if a%b == 0:
            return b
        else:
            a = a%b
        
        if b%a == 0:
            return a
        else:
            b = b%a
            
a,b,c = li()
gcd = findGCD(a,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 a * i % b == c:
        print("YES")
        break
else:
    print("NO")

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

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

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

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

print(ans)

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

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

rem_A = A % B

pass

for i in range(1, 101):
    sum_rem = rem_A * i
    if sum_rem % B == C:
        ans = 'YES'

print(ans)

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

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

X = set()

for i in range(1,101):
  X.add((A*i)%B)

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

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

for i in range(2,B+1):
    D.append((D[0]*i)%B)
    if C in D:
        print("YES")
        exit()
print("NO")

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

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

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

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

Solution (Python):
A,B,C = map(int,input().split())
i =0
AA = A
while i <B:
    i+=1
    if AA%B ==C:
        print('YES')
        exit()
    AA += A
print('NO')

Solution (Python):
A, B, C = [int(i) for i in input().split()]
num = 0
apperedNum = []
ans = "NO"

while(True):
    num += A
    remain = num % B
    if remain == C:
        ans = "YES"
        break
    elif remain in apperedNum:
        break
    apperedNum.append(remain)

print(ans)

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

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

Solution (Python):


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

if __name__ == '__main__':
    main()

Solution (Python):


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

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

if __name__ == '__main__':
    main()

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

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

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

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

Solution (Python):
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
AtoZ = [chr(i) for i in range(65,65+26)]
atoz = [chr(i) for i in range(97,97+26)]

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


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


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


p = gcd(a,b)

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

Solution (Python):
A,B,C = map(int,input().split())
i =0
AA = A
while i <B:
    i+=1
    if AA%B ==C:
        print('YES')
        exit()
    AA += A
print('NO')

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

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())
print(["NO","YES"][c in set((a * i) % b for i in range(1, 10000))])

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

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

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

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

AA = [A*(i+1) for i in range(B)]

flag = 0

for i in AA:
    if i % B == C:
        flag = 1
        print("YES")
        break

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

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

flag=-1

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

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

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

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

Solution (Python):
a, b, c = list(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):
    mod = (A * i) % B
    if mod == C:
        print("YES")
        break
else:
    print("NO")

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

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


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

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

while a % b != 0:
  a, b = b, a % b

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

Solution (Python):


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

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

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

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

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

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

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

if(i==B+1):
	print("NO")

Solution (Python):


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


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

Solution (Python):


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

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

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

Solution (Python):
a, b, c = [int(_) for _ in input().split(' ')]
if any([(x * a) % b == c for x in range(b)]):
    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 % b == c:
        flag = 1
        break
if flag:
    print("YES")
else:
    print("NO")

Solution (Python):
a,b,c = map(int,input().split())
sur = []
check = True
i = 1
while check:
	if (a*i)%b not in sur:
		sur.append((a*i)%b)
		i += 1
	else:
		check = False

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

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

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

Solution (Python):
A,B,C=map(int,raw_input().split())
possible=False
for k in range(1,1001):
  if k*A % B == C:
    possible = True
if possible:
  print 'YES'
else:
  print 'NO'

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

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

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

first_rest = A%B
if first_rest == C:
    print("YES")
    
else:
    i = 2
    while(1):
        if (A*i)%B == C:
            print("YES")
            break
        else:
            if (A*i)%B == first_rest:
                print("NO")
                break
            else:
                i += 1

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

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

Solution (Python):
A, B, C = map(int, input().split())
a = A % B
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 n in range(a,101*a,a):
    if n%b == c:
        print('YES')
        break
else:
    print('NO')

Solution (Python):
A, B, C = map(int, input().split())
r = [(A * k) % B for k in range(B)]
print(["NO", "YES"][C in r])

Solution (Python):
A, B, C  = map(int, input().split())
a = A
while(a <= 10000):
    if(a%B == C):
        print("YES")
        exit()
    a += A
print("NO")

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

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

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

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

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

sousu=0

for i in range(1,10000):
    sousu+=a
    if sousu%b==c:
        print("YES")
        exit()
print("NO")

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

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

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

Solution (Python):
a, b, c = map(int, input().split())
i = a
rec = []
flag = False
while a < 100000:
    mod = a % b
    if mod == c:
        flag = True
        break
    else:
        a += i

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

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

Solution (Python):
a, b, c = map(int, 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())
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())
n = a
while True:
	if n % b == c:
		print("YES")
		break
	n += a
	if n % b == a % b:
		print("NO")
		break

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

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

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

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

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

d = 0
ans = 'NO'
for i in range(b):
    d += a
    if d%b == c:
        ans = 'YES'
        break
print(ans)

Solution (Python):
from math import modf


A, B, C = [int(elem) for elem in input().split(' ')]
remainder_set = set()

current_num = A
multiplier = 2
while True:
    remainder = current_num % B
    already_included = remainder in remainder_set
    if already_included:
        break
    else:
        remainder_set.add(remainder)
        current_num = A * multiplier
        multiplier += 1

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

Solution (Python):
a,b,c=map(int, input().split())
x=a
ans=0
for i in range(b):
    if x%b==c:
        ans+=1
        break
    else:
        x+=a
print('YES') if ans else 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, raw_input().split())
lst = [A % B]
ans = 'NO'

while True:
	tmp = (lst[-1] + A) % B
	if tmp == lst[0]:
		break
	else:
		lst.append(tmp)

if C in lst: ans = 'YES'

print ans

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

i=1
while(True):
    if (A*i)%B == C:
        print("YES")
        break
    elif (A*i)%B == 0:
        print("NO")
        break
    i+=1

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

if flag !=1:
    print('NO')

Solution (Python):
import math
import sys

def getinputdata():

    
    array_result = []
    
    data = input()

    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result

arr_data = getinputdata()

a = int(arr_data[0][0])
b = int(arr_data[0][1])
c = int(arr_data[0][2])



cnt=1

while cnt<= 100:
    
    if (c + b * cnt) % a ==0:
        
        print("YES")
        break
        
    cnt+=1
    
else:
        
    print("NO")

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

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

Solution (Python):
def exists(a, b, c):
    for i in range(b):
        if (i * (a % b)) % b == c % b:
            return True
    return False


if __name__ == '__main__':
    a, b, c = map(int, input().split())
    print('YES') if exists(a, b, c) else print('NO')

Solution (Python):
a, b, c = map(int, input().split())
ok = False
k = a
for _ in range(b):
    if k % b == c:
        ok = True
        break
    k += a
if ok: print('YES')
else: print('NO')

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

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

Solution (Python):
def g(a,b):
    while b:a,b=b,a%b
    return a
a,b,c=map(int,input().split());print(['NO','YES'][c%g(a,b)==0])

Solution (Python):

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

Solution (Python):





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

    while count < (b + 1):
        if ((a * count) % b) == c:
            print('YES')
            exit()

        count += 1

    print('NO')

Solution (Python):





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

    while count < 10001:
        if ((a * count) % b) == c:
            print('YES')
            exit()

        count += 1

    print('NO')

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

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

Solution (Python):


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

result = []
i = 1
while True:
    tmp = (a * i) % b
    if tmp not in result:
        result.append(tmp)
        i += 1
    else:
        break
if c in result:
    print('YES')
else:
    print('NO')

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

Solution (Python):
a, b, c = map(int, input().split())
num = 0
while True:
    num += a
    if num % b == c:
        print('YES')
        break
    if num == a * b:
        print('NO')
        break

Solution (Python):
def gcd(x,y):
    p=max([x,y])
    q=min([x,y])
    if p%q==0:
        return q
    else:
        return gcd(q,p%q)

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")
    exit()
print("NO")

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

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

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')
        exit()
print('NO')

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

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

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

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

Solution (Python):

"""
https://abc060.contest.atcoder.jp/tasks/abc060_b

"""
import sys
from sys import stdin
input = stdin.readline


def solve(A, B, C):
    rem = []
    i = 1
    while True:
        t = (A*i) % B
        if not t in rem:
            rem.append(t)
        i += 1
        if i > 100000:
            break
    if C in rem:
        return 'YES'
    else:
        return 'NO'


def main(args):
    A, B, C = map(int, input().split())
    ans = solve(A, B, C)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])

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

def foo(a, b, c):
    seen = set()
    m = a % b
    i = m
    while i not in seen :
        if i == c:
            print("YES")
            return 
        seen.add(i)
        i = (m + i) % b
    print("NO")
foo(a, b, c)

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

for i in range(1, b+1):
   cnt += 1
   p = i*a
   if p%b==c:
      print("YES")
      break

if cnt == b:
   print("NO")