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

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

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

ka = a
m = ka % b
while True:
    if ka % b == c:
        print('YES')
        exit(0)
    ka += a
    if ka % b == m:
        break
print('NO')

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

Solution (Python):
import sys
A, B, C = map(int, input().split())
N = A
while N < A * B:
    if N % B == C:
        print('YES')
        sys.exit()
    N += A
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())

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

print(res)

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(101):
    if ( (A % B) * i ) % B == C:
        print('YES')
        break
else:
    print('NO')

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

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

Solution (Python):
import sys

A, B, C = map(int, input().split())
i = 1
while (A*i)%B != C:
    i += 1
    if i > 100:
        print('NO')
        sys.exit()
print('YES')

Solution (Python):
from collections import defaultdict

def readInt():
  return int(input())
def readInts():
  return list(map(int, input().split()))
def readChar():
  return input()
def readChars():
  return input().split()

a,b,c = readInts()

i = a
his = []
while 1:
  if i%b==c:
    print("YES")
    exit()
  else:
    if i%b in his:
      print("NO")
      exit()
    else:
      his.append(i%b)
      i+=a

Solution (Python):
bai,waru,ama = [int(x) for x in input().split()]
han = "NO"
for i in range(1,10000):
    if bai*i%waru == ama:
        han = "YES"
print(han)

Solution (Python):





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


s = 0
mods = []
while True:
    s += a

    mod = s % b

    if mod == c:
        res = 'YES'
        break
    elif mod in mods:
        res = 'NO'
        break

    mods.append(mod)

print(res)

Solution (Python):
a,b,c=map(int,input().split())
x=1
fl=False
while x<b:
  if x*a%b==c:
    fl=True
    break
  x+=1
if fl:
  print("YES")
else:
  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()
    else:
        pass
print('NO')

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

i = 0
while i < 100:
  if (a*i-c)%b == 0:
    print('YES')
    exit()
  i += 1
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()
  else:
    continue
print("NO")

Solution (Python):









import os
import sys




def main():
    a, b, c = map(int, input().split())
    for i in range(100):
        if float((a*i-c)/b).is_integer():
            print("YES")
            return
    print("NO")



if __name__ == "__main__":
    main()

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

import math
N = (A * B) // math.gcd(A, B)

array_A = [0]*N
array_B = [0]*N

for i in range(A, N+1, A):
    array_A[i-1] = 1

for i in range(C, N+1, B):
    array_B[i-1] = 1

possible = 0
for i in range(N):
    possible += array_A[i]*array_B[i]

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

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

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

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

Solution (Python):


import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

a, b, c = LI()
for i in range(a, a*b+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,10**5):
  if (A*i)%B==C:
    print('YES')
    exit()
print('NO')

Solution (Python):
import math
A,B,C = map(int,input().split())
num = math.gcd(math.gcd(A,B),C)
A = A//num
B = B//num
C = C//num
for i in range(1,100000):
    if (A*i)%B == 1:
        print('YES')
        exit()
print('NO')

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

lst = []
for i in range(1,100):
    lst.append(A * i)


for i in range(1,3):
    for v in itertools.combinations(lst,i):
        if sum(v) % B == C:
            print('YES')
            exit()
print('NO')

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

for k in range(1,10001):
  if (k*a-c)%b==0:
    print("YES")
    exit()
print("NO")

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

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

Solution (Python):
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))

a,b,c = iim()
num = a%b

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

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

resolve()

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

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

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

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

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

Solution (Python):
import sys









input = sys.stdin.readline

getS = lambda: input().strip()
getN = lambda: int(input())
getList = lambda: list(map(int, input().split()))
getZList = lambda: [int(x) - 1 for x in input().split()]

INF = 10 ** 20
MOD = 1000000007

def solve():
    a,b,c = getList()
    for i in range(1, b * 101):
        if (a * i) % b == c:
            print("YES")
            return
    print("NO")
    return
def main():
    n = getN()
    for _ in range(n):
        solve()
if __name__ == "__main__":
    
    solve()

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):
import math
a,b,c=map(int,input().split())
if c%(math.gcd(a,b))==0:
  print('YES')
else:
  print('NO')

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

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

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

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

Solution (Python):

from math import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement




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

Solution (Python):

from math import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement




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

Solution (Python):

from math import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement




a, b, c = map(int, input().split())
i = 1
ok = False
while i<=b-1:
    if (a*i-c)%b != 0: i+=1
    else:
        ok = True
        break
if ok: print("YES")
else: print("NO")

Solution (Python):

from math import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement




a, b, c = map(int, input().split())
i = 1
ok = False
while i<=b:
    if (a*i-c)%b != 0: i+=1
    else:
        ok = True
        break
if ok: print("YES")
else: print("NO")

Solution (Python):

from math import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement




a, b, c = map(int, input().split())
i = 1
ok = False
while i<b+1:
    if (a*i-c)%b != 0: i+=1
    else:
        ok = True
        break
if ok: print("YES")
else: print("NO")

Solution (Python):

from math import gcd
from collections import Counter, deque, defaultdict
from heapq import heappush, heappop, heappushpop, heapify, heapreplace, merge
from bisect import bisect_left, bisect_right, bisect, insort_left, insort_right, insort
from itertools import accumulate, product, permutations, combinations, combinations_with_replacement




a, b, c = map(int, input().split())
i = 1
ok = False
while i<2*b:
    if (a*i-c)%b != 0: i+=1
    else:
        ok = True
        break
if ok: print("YES")
else: print("NO")

Solution (Python):
def main():
    a, b, c = map(int, input().split())
    for num in range(a, 50000, a):
        if num % b == c:
            print('YES')
            return

    print('NO')

if __name__ == "__main__":
    main()

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

for n in range(10000):
  if n%A==0 and n%B==C:
    a = "YES"

print(a)

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

for n in range(10000):
  if n%A==0 and n%B==C:
    a = "YES"

print(a)

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 = list(map(int,input().split()))
lis = [ (A * i) % B for i in range(1,B+1)]
if C in lis:
    print('YES')
else:
    print('NO')

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

if A < 0 or A > 100 or B < 0 or B > 100:
    sys.exit()
if not ( C >= 0 or C < B ):
    sys.exit()

tmp = 0
result = "NO"
for I in range(B):
    tmp = A * I % B
    if tmp % B == C:
        result = "YES"

print(result)

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

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

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):
import math
A, B, C = map(int, input().split())

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

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

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(1, b+1):
    k, r = divmod(a*i, b)
    if r == c:
        print('YES')
        break
else:
    print('NO')

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

Solution (Python):
a, b, c = map(int, input().split())
l = []
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,B+1):
    if A*i % B == C:
        print('YES')
        break
else:
    print('NO')

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

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

print(ans)

Solution (Python):
a,b,c = map(int, input().split())
for i in range(1,1005):
    if (a*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):
from fractions import gcd
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())
d = a % b
A = {d}
while d != 0:
  d += a
  d %= b
  A.add(d)
print('YES' if c in A else 'NO')

Solution (Python):
A,B,C=map(int,input().split())
remainders=[]
n=1
while True:
    tmp=(A*n)%B
    if not tmp in remainders:
        remainders.append(tmp)
        n+=1
    else:
        break

remainders.sort()
if C==0:
    print("YES")
else:
    if len(remainders)==1:
        print("NO")
    else:
        if remainders[1]==1:
            print("YES")
        else:
            if C%remainders[1]==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')
    exit()
print('NO')

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

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

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

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

Solution (Python):






from collections import deque,defaultdict











import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
a,b,c = readInts()
dic = defaultdict(int)
m = a
while True:
    
    if a%b == c:
        print('YES')
        exit()
    if dic[a%b] != 0:
        print('NO')
        exit()
    else:
        dic[a%b] = 1
    a += m

Solution (Python):
import math
import string
import collections
from collections import Counter
from collections import deque
from decimal import Decimal
import sys
import fractions
from operator import itemgetter
import itertools


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


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor



dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
a, b, c = map(int, input().split())
for i in range(10**5):
    ans = a*i
    if ans % 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())
flag = 0
for k in range(1,B+1):
    if (k*A)%B==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(1, 200):
    if a*i % b == c:
        print('YES')
        exit()
print('NO')

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

ans = 'NO'
for x in range(0,101):
    for y in range(0,101):
        if A * x == B * y + C:
            ans = 'YES'
print(ans)

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

sum_a = 0

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

print("NO")

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

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

print('NO')

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

res = a%b

for i in range(1, b):
    if (res*i)%b == c:
        print('YES')
        sys.exit()
        break
print('NO')

Solution (Python):
A, B, C = list(map(int, input().split()))
rs = []
flag = 0

for i in range(1, int(1e20)):
    r = A * i % B
    if r == C:
        flag = 1
        break
    if r in rs:
        break
    rs.append(r)

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

Solution (Python):



import os
import sys







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

    
    
    

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

    return


if __name__ == '__main__':
    main()

Solution (Python):



import os
import sys







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

    
    
    

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

    return


if __name__ == '__main__':
    main()

Solution (Python):
def main():
    A, B, C = map(int,input().split())
    temp = 1
    for i in range(1, B+1):
        temp = A*i
        if temp%B == C:
            return 'YES'

    return 'NO'

print(main())

Solution (Python):
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

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

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

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

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

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 math
import string
import collections
from collections import Counter
from collections import deque
from decimal import Decimal
import sys
import fractions


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


def nCr(n, r):
    return math.factorial(n)//(math.factorial(n-r)*math.factorial(r))


def has_duplicates2(seq):
    seen = []
    for item in seq:
        if not(item in seen):
            seen.append(item)
    return len(seq) != len(seen)


def divisor(n):
    divisor = []
    for i in range(1, n+1):
        if n % i == 0:
            divisor.append(i)
    return divisor



dx = [-1, -1, -1, 0, 0, 1, 1, 1]
dy = [-1, 0, 1, -1, 1, -1, 0, 1]
a, b, c = map(int, input().split())
for i in range(10**5):
    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")
        exit()
else:
    print("NO")

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

Solution (Python):
nums = [int(e) for e in input().split()]
count=0
for i in range(nums[1]):
    if (nums[0]*(i+1))%nums[1]==nums[2]:
        count=1
if count==0:
    print("NO")

else:
    print("YES")

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

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

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

Solution (Python):
def ans(a, b, c) : 
  if c == 0 : 
    print('YES')
    
  elif a % b == 0 : 
    print('NO')
    
  else : 
    d = a % b
    for i in range(b) : 
      if (d * i) % b == c :
        print('YES')
        return
    print('NO')

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

ans(a, b, c)

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






dic = {a%b:0}
now = a
while(1):
    now += a
    if now%b in dic:
        break
    else:
        dic[now%b]= 0

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

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

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

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









"""
Aの倍数の集合を考える
s1 = a*1
s2 = a*2
s3 = a*3
・・・



Bで割ってC余る数の集合を考える
k0 = C
k1 = C + B
k2 = C + 2B
k3 = C + 3B
・・・
k999 = c + 999B

k0からk999まで、1000個の整数がひとつもAの倍数でないとしたら、
「Aの倍数ではない」とはつまり
Aで割ると1余る or 
Aで割ると2余る or
Aで割ると3余る or 
・・・
Aで割ると(A-1)余る
つまりパターンとしては A-1 通りしかない

Aで割ったときの余りが
k0 ... 1
k1 ... 3
k2 ... 1






for で回せば,YESの判定はなんとなくできそうだが
NOの判定はどうやればいい？





"""


k = []
result = 'NO'

for i in range(a+1):
    

    k.append(c + b*i)

for i in range(a+1):
    p,q = divmod(k[i],a)   
    if q==0:
        result = 'YES'


print(result)

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

counter = 1
possible_remainders = []


while counter >= 0:
  remainder = (A*counter)%B
  if remainder in possible_remainders:
    break
  else:
    possible_remainders.append(remainder)
    counter += 1

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

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

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

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

    ans = str()
    x = a

    ans = str()
    for i in range(0, 100):
        if x > a + b:
            break
        if x > b:
            x = x % b
        if x == c:
            ans = "YES"
            break
        if i == 100 - 1:
            ans = "NO"
        
        x += a
    print(ans)

resolve()

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

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

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())
ls = []
p = a%b
for i in range(1,b+2):
    q = p * i
    if q >= b:
        q %= b
    if q not in ls:
        ls.append(q)
    else:
        break
if c in ls:
    print("YES")
else:
    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())
a_temp = a

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

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

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

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

print(frag)

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

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

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

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

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

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

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

now = a

check = 0

for i in range(1000000):

  if now % b == c:
    check += 1
    break
  else:

    now += a

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

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

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

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

Solution (Python):
A, B, C = map(int, input().split())
c = set()
tmp = 0
while 1:
  tmp += A
  if not tmp % B in c:
    c.add(tmp % B)
  else:
    break

print('YES' if C in c 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')
        break
else:
    print('NO')

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

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

Solution (Python):
from fractions import gcd


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

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

    rs = [0] * B
    r = A % B

    s = r
    while True:
        if rs[s]: break
        rs[s] = 1
        s = (s + r) % B

    print('YES' if rs[C] else 'NO')


if __name__ == '__main__':
    main()

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

print(ans)

Solution (Python):
A,B,C=map(int,input().split())
ms=[0]*B
i=1
ans='NO'
while True:
  m=A*i%B
  if m==C:
    ans='YES'
    break
  else:
    if ms[m]==0:
      ms[m]=1
    else:
      break
  i+=1
  pass
print(ans)