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

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

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

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

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

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

Solution (Python):
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')

Solution (Python):
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))


if __name__ == '__main__':
    main()

Solution (Python):
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')
    
    break
  elif pivot in mod:
    print('NO')
    break
  else:
    mod.append(pivot)
    step=step+1

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

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())
while B != 0:
  A, B = B, A % B
print('YES' if C % A == 0 else 'NO')

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

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

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

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

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

print('NO')

Solution (Python):
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')

Solution (Python):
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")

Solution (Python):


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)

Solution (Python):


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)

Solution (Python):
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")

Solution (Python):
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)

Solution (Python):
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")

Solution (Python):
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')

Solution (Python):
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')

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

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

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

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

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

Solution (Python):
import sys, re
from math import ceil, floor, sqrt, pi, factorial, gcd
from copy import deepcopy
from collections import Counter, deque
from heapq import heapify, heappop, heappush
from itertools import accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce
from decimal import Decimal, getcontext

def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]
def lcm(a, b): return a * b // gcd(a, b)
sys.setrecursionlimit(10 ** 6)
INF = float('inf')
MOD = 10 ** 9 + 7
num_list = []
str_list = []

def main():
    a, b, c = i_map()

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

    print('NO')

if __name__ == '__main__':
    main()

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(1,b+1):
    mod = a*i % b
    if mod == 0:continue
    elif c % mod == 0:
        ans = 'YES'
        break

print(ans)

Solution (Python):
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')
    exit()
elif i == 0 and c != 0:
    print('NO')
    exit()

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

Solution (Python):
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')

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

amari = []

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

print('YES' if C in amari else 'NO')

Solution (Python):
import re
import copy

def accept_input():
    a,b,c = 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")

Solution (Python):
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)

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(1,B+1):
  if A*i%B == C:
    ans = "YES"

print(ans)

Solution (Python):

import sys

YES = "YES"  
NO = "NO"  


def solve(A: int, B: int, C: int):
    for i in range(1, B+1):
        if A * i % B == C:
            print(YES)
            return
    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):
import sys
A, B, C = map(int, input().split())

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

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

Solution (Python):
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)

Solution (Python):
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")
        sys.exit(0)
    elif a.count(cnt%B) >1:
        print("NO")
        sys.exit(0)

Solution (Python):
import math

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

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

Solution (Python):
from math import gcd
A, B, C = map(int, input().split())
x = gcd(A, B)
if C % x == 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')
        break
    elif (a * i) % b == 0 and i > 0:
        print('NO')
        break

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

dic = {}
tmp = A%B
while not(tmp in dic):
    dic[tmp]=0
    tmp = (tmp+(A%B))%B


print("YES" if C in dic else "NO")

Solution (Python):

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


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


if __name__ ==  "__main__":
    main()

Solution (Python):

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


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


if __name__ ==  "__main__":
    main()

Solution (Python):
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)

Solution (Python):
A,B,C = 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")

Solution (Python):
import math

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

Solution (Python):
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")

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

Solution (Python):
import sys
from collections import deque
from bisect import bisect_left, bisect_right, insort_left, insort_right 
from heapq import heapify, heappop, heappush
from math import *

sys.setrecursionlimit(10**6)
INF = 10**20

def mint():
    return map(int,input().split())
def lint():
    return map(int,input().split())
def judge(x, l=['Yes', 'No']):
    print(l[0] if x else l[1])

a,b,c = mint()
judge(c%gcd(a,b)==0,['YES','NO'])

Solution (Python):


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)

Solution (Python):
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")

Solution (Python):
A,B,C=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')

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

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

Solution (Python):
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: 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')
        exit()
else:
    print('NO')

Solution (Python):
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')
        sys.exit()
print('NO')

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

Solution (Python):
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")

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(100):
  if ((C+B*i)/A).is_integer():
    print('YES')
    exit()
print('NO')

Solution (Python):
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")

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

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

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

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


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

    def judge():
        for i in range(0, 100000):
            cur = A * i
            if cur % B == C:
                return True
        return False

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


if __name__ == '__main__':
    main()

Solution (Python):
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')
        exit()
    D+=A
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"

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):
from fractions import gcd
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())
modb = [0]*100
for i in range(1,100000):
    n = a*i
    m = n%b
    
    if(modb[m] != 0):
        break
    modb[m] = 1

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

Solution (Python):
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')

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 i*A % B == C:
        print("YES")
        exit()
print("NO")

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

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

Solution (Python):
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")

Solution (Python):
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)

Solution (Python):
import sys
sys.setrecursionlimit(4100000)
import math
import itertools
INF = float('inf')
from heapq import heapify, heappop, heappush

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

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


if __name__ == '__main__':
    main()

Solution (Python):
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)

Solution (Python):
from math import gcd
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())
s = "NO"
for i in [a * j for j in range(1, b)]:
    if i % b == c:
        s = "YES"
        break

print(s)

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

Solution (Python):
a,b,c = map(int,input().split())
i = 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

Solution (Python):

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

result = 'NO'

num = 0

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

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

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

Solution (Python):
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')

Solution (Python):
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')

Solution (Python):
def zz():
    return 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")

Solution (Python):

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

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

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

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

Solution (Python):
x,y,z=map(int,input().split())
l=[]
for i  in range(1,y+1):
    l.append((x*i)%y)
if(z in l):
    print("YES")
else:
    print("NO")

Solution (Python):
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')

Solution (Python):
import math
import sys
import os
from operator import mul

sys.setrecursionlimit(10**7)

def _S(): return sys.stdin.readline().rstrip()
def I(): return int(_S())
def LS(): return list(_S().split())
def LI(): return list(map(int,LS()))

if os.getenv("LOCAL"):
    inputFile = basename_without_ext = os.path.splitext(os.path.basename(__file__))[0]+'.txt'
    sys.stdin = open(inputFile, "r")
INF = float("inf")


A,B,C = LI()
ans = False

gcd = math.gcd(A,B)
if C % gcd ==0:
    ans = True

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

Solution (Python):
a,b,c = map(int, input().split())
sm=a
x=a%b
sm%=b
if sm==c:
    print("YES")
    exit()

for i in range(10**5):
    sm+=a
    sm%=b
    
    if sm==c:
        print("YES")
        exit()
    elif sm==x:
        break

print("NO")

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

print("NO")

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

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

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

Solution (Python):
import bisect,collections,copy,itertools,math,string
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()
def LS(): return list(sys.stdin.readline().rstrip().split())
def main():
    a,b,c = LI()
    reset = set()

    for i in range(b):
        reminder = (a*i)%b
        reset.add(reminder)

    print("YES" if c in reset else "NO")

main()

Solution (Python):
A,B,C=map(int,input().split())
i=1
while A*i<max(A,B)*100:
    if A*i%B==C:
        print("YES")
        break
    i+=1
else:
    print("NO")

Solution (Python):
import math

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

d = math.gcd(a, b)

print("YES" if c % d == 0 else "NO")

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

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

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())
x=[]
ans="NO"
for i in range(B):
    x.append((A*i) % B)
    
if C in x:
    ans="YES"
print(ans)

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

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

print('NO')

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

Solution (Python):
def main():
    A, B, C = map(int, input().split())
    lst = [False] * B

    num = 0
    for _ in range(B):
        num += A
        d = num % B

        if d == C:
            flag = True
            break

        if lst[d] == True:
            flag = False
            break

        lst[d] = True

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


if __name__ == "__main__":
    main()

Solution (Python):




import sys
from io import StringIO
import unittest


class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """7 5 1"""
        output = """YES"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """2 2 1"""
        output = """NO"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """1 100 97"""
        output = """YES"""
        self.assertIO(input, output)

    def test_入力例_4(self):
        input = """40 98 58"""
        output = """YES"""
        self.assertIO(input, output)

    def test_入力例_5(self):
        input = """77 42 36"""
        output = """NO"""
        self.assertIO(input, output)


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

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


if __name__ == "__main__":
    
    resolve()

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

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

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

Solution (Python):

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

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

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

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

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

Solution (Python):
A, B, C = map(int, input().split())
N = A % B
M, i = 0, 2
while M != N:
    M = i * N % B
    if M == C:
        print("YES")
        break
    i += 1
else:
    print("NO")

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

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

t = 0
while t != b:
  t += 1
  if a*t%b == c:
    print("YES")
    exit()
print("NO")

Solution (Python):
A, B, C = map(int, input().split())
dp = [-1] * 100
_A = A
while True:
    if A % B == C:
        print("YES")
        break
    if dp[A%B] != -1:
        print("NO")
        break
    dp[A%B] = 1
    A = A % B + _A

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

t = 0
while t != b:
  t += 1
  if a*t%b == c:
    print("YES")
    exit()
print("NO")

Solution (Python):
A,B,C = map(int, input ().split ())
X = A%B
if X == C:
  print ('YES')
else:
  i = 2
  while True:
    x = (i*A)%B
    if x == C:
      print ('YES')
      break
    elif x == X:
      print ('NO')
      break
    i += 1

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

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

Solution (Python):
import math

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

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

Solution (Python):
import math

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

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

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

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





j=0
while j<=10000000:
  if j%B==C:
    print("YES")
    break
  j+=A
else:
  print("NO")

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

Solution (Python):
A,B,C=map(int,input().split())
x=A%B
y=max(A,B)
for i in range(y+1):
	if (x*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)
if c in l:
    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()
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")