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

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

for n in range(1, 101):
    if (A*n%B) == C:
        ans = "YES"
        break
    else:
        ans = "NO"

print(ans)

Solution (Python):
n,m,k=map(int,input().split())
for i in range(1,101):
  if (n*i)%m==k:
    print('YES')
    quit()
print('NO')

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

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

print("NO")

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    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)
resolve()

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

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

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

Solution (Python):
def GCD(x, y):
    if y == 0:
        return x
    return GCD(y, x % y)


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

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

Solution (Python):
import sys
from collections import Counter
from collections import deque
import heapq
import math
import fractions
import bisect
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

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

Solution (Python):
import sys
from collections import Counter
from collections import deque
import heapq
import math
import fractions
import bisect
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

a,b,c=mp()
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())

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

Solution (Python):
def computeGCD(x, y): 
  
    if x > y: 
        small = y 
    else: 
        small = x 
    for i in range(1, small+1): 
        if((x % i == 0) and (y % i == 0)): 
            gcd = i 
              
    return gcd 
a,b,c=map(int,input().split())
r=computeGCD(a,b)
if c%r==0:
  print('YES')
else:
  print('NO')

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    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")


if __name__ == '__main__':
    resolve()

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

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

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

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

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

s=set([])
for i in range(B):
  s.add((A*i)%B)
if C in s:
  print("YES")
else:
  print("NO")

Solution (Python):
import sys

numbers = sys.stdin.readline().split(' ')


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


for i in range(B):
    if A*i % B == C:
        print('YES')
        sys.exit()
    else:
        continue



print('NO')

Solution (Python):
A, B, C =map(int,input().split())
flag=False
for i in range(B):
  if (i*A)%B==C:
    flag=True
    
if flag:
  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):
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())

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

flg=False


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

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

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

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

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

print("NO")

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

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

for i in range(1,100):
    mod = (def_mod * i) % B
    if mod in mod_list:
        break
    else:
        mod_list.append(mod)
if C in mod_list:
    print("YES")
else:
    print("NO")

Solution (Python):

def main():
    A,B,C  = map(int, input().split()) 
    temp = A
    while temp % B != C:
        temp += A
        if temp % B == A % B:
            print('NO')
            return
    print('YES')


if __name__ == '__main__':
    main()

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

flag = False

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

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

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

def gcd(x,y):
    while y!=0:
        tmp=x%y
        x=y
        y=tmp
    return x
    
    
if c % gcd(a,b) == 0:
    print("YES")
else:
    print("NO")

Solution (Python):
A,B,C=map(int,input().split())
d=[]
i=1
while 1:
  amari = A*i % B
  if amari in d:
    print('NO')
    break
  d.append(amari)
  if amari == C:
    print('YES')
    break
  i+=1

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

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

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

l=[]
for i in range(1, b):
    l.append((i*a)%b)

if c in l:
    print("YES")
else:
    print("NO")

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

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

print('NO')

Solution (Python):
import sys
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
A,B,C = LI()
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 = False
for i in range(A * B + 1):
    if (A * i) % B == C:
        ans = True

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

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





for i in range(1000):
    if not ((B*i + C)/A)%1:
        print('YES')
        break
else:
    print('NO')

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


for i in range(100000):
  E = D*i % B
  if E in ans_list:
    break
  ans_list.append(E)
  
    
if C in ans_list:
  print("YES")
else:
  print("NO")

Solution (Python):
from itertools import count

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

for n in count(start=A // C):
    r = (n * A - C) % B
    if r == 0:
        print("YES")
        break
    else:
        if r not in reminders:
            reminders.append(r)
        else:
            print("NO")
            break

Solution (Python):

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


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

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

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

print(result)

Solution (Python):


import sys






























def main():
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
        
    def check(a, b, c):
        for i in range(1, b+1):
            if (a * i) % b == c:
                return True
        return False


    a, b, c = map(int, input().split())
    print('YES') if check(a, b, c) else print('NO')
        


if __name__ == "__main__":
    main()

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 = list(map(int,input().split()))
for i in range(1,10001):
    if i%A == 0 and i%B == C:
        print('YES')
        exit()
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())
res = False
for i in range(a, a * b + 1, a):
    if i % b == c:
        res = True

print("YES" if res == True else "NO")

Solution (Python):
a,b,c = list(map(int, input().split()))
MOD=set([])
i=0
while True:
    m=(b*i+c)%a
    if m==0:
        print('YES')
        break
    if m in MOD:
        print('NO')
        break
    MOD.add(m)
    i+=1

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

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

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

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


resolve()

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


def log(*args):
    print(*args, file=sys.stderr)


def main():
    A, B, C = map(int, input().strip().split())
    rems = set()
    for i in range(0, 101):
        v = (A * i) % B
        if v == C:
            print("YES")
            return
        if v in rems:
            print("NO")
            return
        rems.add(v)


if __name__ == '__main__':
    main()

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

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

Solution (Python):
import sys

readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

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

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

Solution (Python):
import sys

readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
read = sys.stdin.buffer.read
sys.setrecursionlimit(10 ** 7)
INF = float('inf')

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

x = 0
visited = set()
while True:
    x += 1
    tmp = B * x + C
    div = tmp % A
    if div == 0:
        print('YES')
        quit()
    if div in visited:
        print('NO')
        quit()
    visited.add(div)

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

c_temp = 0
for i in range(10000):
    c_temp = (B * i) + C
    if (c_temp % A) == 0:
        Flag = True

if Flag is True:
    print('YES')
else:
    print('NO')

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

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

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

Solution (Python):
a, b, c = list(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(1, 100):
    if a*i % b == c:
        print('YES')
        break
else:
    print('NO')

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
from collections import defaultdict
from collections import deque
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]


def Yes(): print("Yes"); return
def No(): print("No"); return


def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr


def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors


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


def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count


def Base_10_to_n(X, n):
  if X//n:
    return Base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def Base_n_to_10(X, n):
  return sum(int(str(X)[-i])*n**i for i in range(len(str(X))))


def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count





A,B,C = inputIL()

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

rest = a % b
num = a

while True:
    if num % b == c:
        print('YES')
        exit()
    num+=a
    if num % b == rest:
        print('NO')
        exit()

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

n = 1
visited = set()
while True:
  mod = n * a % b
  if mod == c:
    print("YES")
    break
  if mod in visited:
    print("NO")
    break
  
  visited.add(mod)
  n += 1

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

count = 0
for n in range(1, b+1):
    if n*a%b==c:
        print("YES")
        count += 1
        break

if count==0:
    print('NO')

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

l = list()
for i in range(B+1):
    l.append(A*i % B)

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

Solution (Python):

import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

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

if __name__ == '__main__':
    main()

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

i = 1
amari = []
while(1):
  tmp = a * i % b
  if tmp in amari:
    break
  else:
    amari.append(tmp)
  i += 1

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

Solution (Python):
import fractions

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

gab = fractions.gcd(a, b)
gbc = fractions.gcd(gab,c)

if gab ==1:
    print("YES")
    exit()
if c ==0:
    print("YES")
    exit()

if gbc == gab:
    print("YES")
    exit()
print("NO")

Solution (Python):
A,B,C = map(int,input().split())
ans =[]
flag =False
for i in range(1,A*B):
    temp =  (A*i)%B
    ans.append(temp)
for j in ans:
    if j == C:
        flag = True
        break
    else:
        flag = False
if flag ==True:
    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 fractions
A, B, C = map(int, input().split())
d = fractions.gcd(A, B)
print('YES' if C % d == 0 else 'NO')

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

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

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

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

ans = False

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

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

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

Solution (Python):




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

flag = False
for i in range(n):
    if (i * a) % b == c:
        flag = True
        break

if flag:
    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())

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

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

Solution (Python):
import sys
import math
import bisect

def solve(a, b, c):
    for i in range(b):
        val = a * (i + 1)
        if val % b == c:
            return True
    return False

def main():
    a, b, c = map(int, input().split())
    if solve(a, b, c):
        print('YES')
    else:
        print('NO')

if __name__ == "__main__":
    main()

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

print("NO")

Solution (Python):
a,b,c=map(int,input().split())
d=a%b
if d==c:
  print("YES")
l=d
while True:
  l+=d
  l%=b
  if l==c:
    print("YES");exit()
  elif l==d:
    print("NO");exit()

Solution (Python):
A, B, C = map(int, input().split())
C_list = []
if A >= B:
    num = A % B
    while num not in C_list:
        C_list.append(num)
        num += A % B
        if num >= B:
            num -= B
elif A < B:
    num = A
    while num not in C_list:
        C_list.append(num)
        num += A
        if num >= B:
            num -= B
print('YES' if C in C_list else 'NO')

Solution (Python):
a,b,c=map(int,input().split())
visited={}
for i in range(b):
    visited[i]=-1

sum=0
while True:
    sum+=a
    rest=sum%b
    if visited[rest]==0:
        print("NO")
        exit()
    visited[rest]=0
    if rest==c:
        print("YES")
        exit()

Solution (Python):
import math
a,b,c=map(int,input().split())
print('YNEOS'[c%math.gcd(a,b)>0::2])

Solution (Python):
def main():
    a, b, c = map(int, input().split())
    add = a
    mods = [0]*b
    i = a % b
    while mods[i] == 0:
        mods[i] = 1
        if i == c:
            print('YES')
            exit()
        a = a+add
        i = a % b
    print('NO')


if __name__ == "__main__":
    main()

Solution (Python):
x, y, z = map(int,input().split())
li = []

for i in range(y):
    li.append((x*i)%y)

if z in li:
    print("YES")
else:
    print("NO")

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

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

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

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

if ans == "YES":
    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):
a, b, c = map(int, input().split())
ans = []
for i in range(101):
    d = a*i % b
    if d in ans:
        break
    ans += [d]
if c in ans:
    print('YES')
else:
    print('NO')

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

Solution (Python):
a,b,c=map(int,input().split())
temp=[]
temp.append(a%b)
i=2
while True:
  temp.append(a*i%b)
  if temp[i-1]==temp[0]:
    break
  i=i+1
count=0
for i in range(0,len(temp)):
  if temp[i]==c:
    count=1
if count==1:
  print("YES")
else:
  print("NO")

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

L = []
l = set(L)
M = A%B
l.add(M)
i = 2
while True:
  if M*i%B == C:
    print("YES")
    break
  else:
    if M*i%B in l:
      print("NO")
      break
    else:
      l.add(M*i%B)
  i += 1

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

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

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

sum = C
ans = 'NO'
cnt = 0

while cnt < A:
    sum += B
    if sum % A == 0:
        print('YES')
        exit()
    cnt += 1
print('NO')

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

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

sum=A
while sum % B != 0:
    sum = sum + A

    if sum%B==C:
        print("YES")
        break
else:
    print("NO")

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

a = a%b

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

Solution (Python):
import sys

def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))

def DD2(d1,d2,init=0): return [[init]*d2 for _ in range(d1)]
def DD3(d1,d2,d3,init=0): return [DD2(d2,d3,init) for _ in range(d1)]

def to_bin(x: int) -> str: return format(x, 'b') 
def to_oct(x: int) -> str: return format(x, 'o') 
def to_hex(x: int) -> str: return format(x, 'x') 
MOD=10**9+7
def divc(x,y) -> int: return -(-x//y)
def divf(x,y) -> int: return x//y
def gcd(x,y):
    while y: x,y = y,x%y
    return x
def lcm(x,y): return x*y//gcd(x,y)
def enumerate_divs(n):
    """Return a tuple list of divisor of n"""
    return [(i,n//i) for i in range(1,int(n**0.5)+1) if n%i==0]
def get_primes(MAX_NUM=10**3):
    """Return a list of prime numbers n or less"""
    is_prime = [True]*(MAX_NUM+1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, int(MAX_NUM**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i*2, MAX_NUM+1, i):
            is_prime[j] = False
    return [i for i in range(MAX_NUM+1) if is_prime[i]]

from itertools import accumulate as acc, combinations as combi, product, combinations_with_replacement as combi_dup
from collections import deque, Counter
from heapq import heapify, heappop, heappush
from bisect import bisect_left


def main():
    a, b, c = MII()
    for i in range(1,b):
        if (a*i)%b == c:
            print('YES')
            return None
    print('NO')

if __name__ == '__main__':
    main()

Solution (Python):
import sys

def IS(): return sys.stdin.readline().rstrip()
def II(): return int(IS())
def MII(): return list(map(int, IS().split()))
def MIIZ(): return list(map(lambda x: x-1, MII()))

def DD2(d1,d2,init=0): return [[init]*d2 for _ in range(d1)]
def DD3(d1,d2,d3,init=0): return [DD2(d2,d3,init) for _ in range(d1)]

def to_bin(x: int) -> str: return format(x, 'b') 
def to_oct(x: int) -> str: return format(x, 'o') 
def to_hex(x: int) -> str: return format(x, 'x') 
MOD=10**9+7
def divc(x,y) -> int: return -(-x//y)
def divf(x,y) -> int: return x//y
def gcd(x,y):
    while y: x,y = y,x%y
    return x
def lcm(x,y): return x*y//gcd(x,y)
def enumerate_divs(n):
    """Return a tuple list of divisor of n"""
    return [(i,n//i) for i in range(1,int(n**0.5)+1) if n%i==0]
def get_primes(MAX_NUM=10**3):
    """Return a list of prime numbers n or less"""
    is_prime = [True]*(MAX_NUM+1)
    is_prime[0] = is_prime[1] = False
    for i in range(2, int(MAX_NUM**0.5)+1):
        if not is_prime[i]: continue
        for j in range(i*2, MAX_NUM+1, i):
            is_prime[j] = False
    return [i for i in range(MAX_NUM+1) if is_prime[i]]

from itertools import accumulate as acc, combinations as combi, product, combinations_with_replacement as combi_dup
from collections import deque, Counter
from heapq import heapify, heappop, heappush
from bisect import bisect_left


def main():
    a, b, c = MII()
    r = a%b
    ri = r
    if r == 0:
        if r == c:
            print('YES')
            return None
        else:
            print('NO')
            return None
    while r < 10**5:
        if r%b == c:
            print('YES')
            return None
        r += ri
    print('NO')

if __name__ == '__main__':
    main()

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

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

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

bool1 = False

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

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

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

  ans = "NO"

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

  print(ans)

if __name__ == "__main__":
  main()

Solution (Python):
def main():
    A, B, C = map(int, input().split())
    ans = 'NO'
    Atmp = A
    for i in range(pow(10,5)):
        if Atmp%B==C:
            ans = 'YES'
            break
        Atmp += A
    print(ans)

if __name__ == "__main__":
    main()

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

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

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

flag = False

for i in range(B):
    
    t = i*A%B
    
    if t == C: 
        flag = True
        

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

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

for i in range(b):
    q, r = divmod(a*i, b)
    if r == c:
        print('YES')
        exit()
print('NO')

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

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