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

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

Solution (Python):
A, B, C = map(int, input().split())
m = A % B
org = m
m = (m + m) % B
while m != org:
    if m == C:
        print('YES')
        exit(0)
    m = (m + org) % B
print('NO')

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

flag=False

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

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

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

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

ans = 0

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

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

Solution (Python):
def yn(a,b,c):
    ans = "NO"
    for i in range(a*b):
        if a * i % b == c:
            ans = "YES"

    return ans

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

if __name__ == '__main__':
    main()

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

def func():
    for i in range(a, 10000, a):
        if i % b == c:
            return "YES"

    return "NO"

print(func())

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

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

ans = 'NO'
for i in range(1, A[1] + 1):
    if i * A[0] % A[1] == A[2]:
        ans = 'YES'
        
print(ans)

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

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

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

x = a % b
i = 1
while i <= b:
  if (x * i) % b == c:
    print('YES')
    quit()
  i += 1
print('NO')

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

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

Solution (Python):
a,b,c = map(int, input().split())
l = []
mod = -1
i = a

while a % b != 0:
  mod = a % b
  l.append(mod)
  a += i
print("YES" if c in l else "NO")

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

Solution (Python):

from fractions import gcd

def pin(type=int):
    return map(type,input().split())


A,B,C=pin()


print(["YES","NO"][C%gcd(A,B) !=0])

Solution (Python):
import fractions
n,m,a=map(int,input().split())
if a%fractions.gcd(n,m)==0:
    print("YES")
else:
    print("NO")

Solution (Python):
import fractions
n,m,a=map(int,input().split())
if a%fractions.gcd(n,m)==0:
    print("YES")
else:
    print("NO")

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

tmp = []
x = a
i = 1
while x % b != 0:
    x = a * i
    tmp.append(x % b)
    i += 1

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

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

tmp = []
x = a
i = 1
while x % b != 0:
    x = a * i
    tmp.append(x % b)
    i += 1

if c in set(tmp):
    print('YES')
else:
    print('NO')

Solution (Python):

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

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

Solution (Python):
"""
author : halo2halo
date : 30, Jan, 2020
"""

import sys
import itertools



read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

bl = False
for i in range(1, 110):
    if (C + B * i) % A == 0:
        bl = True

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

Solution (Python):


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


if __name__ == "__main__":
    main()

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

Solution (Python):
A, B, C = map(int, input().split())
b = False
for a in range(1, B):
    if A*a-C >= 0:
        if (A*a-C)%B == 0:
            b = True
print("YNEOS"[not(b)::2])

Solution (Python):
A, B, C = [int(i) for i in input().split()]
history = set()
a = A
ans = "NO"
while True:
    r = a % B
    if r in history:
        break
    if r == C:
        ans = "YES"
        break
    history.add(r)
    a += A
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):
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):
import fractions

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

if gcd == 1 and C != 0 or gcd != 1 and fractions.gcd(gcd, C) != 1:
    print('YES')
else:
    print('NO')

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

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

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

print("NO")

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

A, B, C = MAP()

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

Solution (Python):
a, b, c = [int(i) for i in 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())
exists = False
for i in range(1, b + 1, 1):
    sum = a * i
    if (sum % b) == c:
        exists = True
        break

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

Solution (Python):
a,b,c=map(int,input().split())
a_=a
s=set()
while True:
  x=a_%b
  if x==c:
    print("YES")
    break
  elif x in s:
    print("NO")
    break
  else:
    s.add(x)
  a_+=a

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):
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    a,b,c=INTM()
    a=a%b
    flg=0
    for i in range(1,b+1):
        if (a*i)%b==c:
            flg=1
    if flg==0:
        print('NO')
    else:
        print('YES')
if __name__ == '__main__':
    do()

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

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

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

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

Solution (Python):
from __future__ import print_function

import sys
input = sys.stdin.readline


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


if __name__ == '__main__':
    main()

Solution (Python):

def main():
    a, b, c = map(int, input().split())
    f = False
    for k in range(b):
        q = a*(b+k)%b
        if q == c:
            f = True
     
    if f:
        print('YES')
    else:
        print('NO')

main()

Solution (Python):
from numpy import*;a,b,c=int_(input().split());print('YNEOS'[all(a*range(b)%b-c)::2])

Solution (Python):
a,b,c=map(int,input().split());print('YNEOS'[all(a*i%b-c for i in range(b))::2])

Solution (Python):
a,b,c=map(int,input().split());print('YNEOS'[all(a*i%b-c for i in range(99))::2])

Solution (Python):




a,b,c = map(int,input().split())
tmp = 0
flag = 0
for i in range(100):
    tmp += a
    if tmp % b == c:
        flag = 1
        break

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

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

Solution (Python):
arr = input().split()
arr = list(map(int,arr))
a = arr[0]
b = arr[1]
c = arr[2]

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

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

Solution (Python):
import sys
input = sys.stdin.readline
A,B,C = [int(i) for i in input().split()]
import fractions
from fractions import gcd
d = fractions.gcd(A,B)
if C % d == 0 :
    print("YES")
else :
    print("NO")

Solution (Python):
A, B, C = map(int, input().split())
for i in range(1, 10000):
    if ((B*i)+C)%A==0:
        count=1
        break
    else:
        count=0
print("YES" if count==1 else "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):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

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

def main():
    a,b,c=MI()
    g=gcd(a,b)
    if c%g:print("NO")
    else:print("YES")

main()

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

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



F=0
kekka=0
i=0
l=[]

while F==0:
    A=(a*i)%b
    if A==c:
        kekka="YES"
        F=1
    else:
        if l.count(A)==0:
            l.append(A)
            i+=1
        else:
            kekka="NO"
            F=1
            
print(kekka)

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



for n in range(1, b+1):
    sum += a
    if sum % 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"
        break

print(ans)

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

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

print(ans)

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

tmp = []
next_num = A
while True:
    tmp.append(next_num % B)
    next_num += A
    if next_num % B in tmp:
        break

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

Solution (Python):

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

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

ans = 'NO'

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

print(ans)

Solution (Python):
import sys
input = sys.stdin.readline
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(a,b*a+1,a):
  if i % b == c:
    print("YES")
    exit(0)
print("NO")

Solution (Python):
abc=list(map(int,input().split()))
from fractions import gcd
ab=gcd(abc[0],abc[1])
if abc[2]%ab==0:
    print("YES")
else:
    print("NO")

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


import numpy as np
import fractions as fra

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

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

Solution (Python):
ABC = input().split()
A, B, C = int(ABC[0]), int(ABC[1]), int(ABC[2])
memo = set()
i = 1
ans = 'NO'

while True:
  cur = (A * i) % B
  if cur == C:
    ans = 'YES'
    break
  if cur not in memo:
    memo.add(cur)
  else:
    break
  i += 1
print(ans)

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

x = a % b

result = 'NO'

if x == 0 and c != 0:
  print(result)
  sys.exit()

past = []
for i in range(1, 100):
  s = (x * i) % b
  if s == c:
    result = 'YES'
    break
  try:
    past.index(s)
    break
  except:
    pass
  past.append(s)

print(result)

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

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

Solution (Python):
import sys
input = sys.stdin.readline
A, B, C = [int(x) for x in input().split()]
AmodB = A % B
if AmodB == 0:
    if C == 0:
        print("YES")
        sys.exit()
    else:
        print("NO")
        sys.exit()

mod = [AmodB]
i = AmodB
while True:
    if C in mod:
        print("YES")
        sys.exit()
    i += AmodB
    i %= B
    if i in mod:
        print("NO")
        sys.exit()
    else:
        mod.append(i)

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

array = []

for i in range(b):
    array.append(a*i % b)
    
ans_list = list(set(array))
    
if c in ans_list:
    print("YES")
else:
    print("NO")

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

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

print('NO')

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

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

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
        break
if flag:
    print("YES")
else:
    print("NO")

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

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

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

print("NO")

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

i = 1
s = set()
while True:
    x = (A * i) % B
    if x in s:
        print("NO")
        break
    if x == C:
        print("YES")
        break
    s.add(x)
    i += 1

Solution (Python):


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

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

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

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

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

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

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

print('YES' if cnt==1 else 'NO')

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

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

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

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

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

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

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

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

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

li=[(i*a)%b for i in range(1,1001)]

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

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

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

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

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

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

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

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

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

Solution (Python):
import sys
import time
bbn=1000000007
	


def gcb(a,b):
	if b == 0:
		return a
	else:
		gcb(b, b%a)
	
def main():
	
	a, b , c = map(int, input().split())
	for i in range(100000):
		if a * i % b == c:
			return 'YES'
	return 'NO'

	
	
	

isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

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

mod_list = []
tot = 0

for i in range(1,101):
    tot += a
    mod_list.append(tot%b)

if mod_list.count(c) >= 1:
    ans = 'YES'
else:
    ans = 'NO'

print(ans)

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

Solution (Python):
a = input().split()
j = 0
d = 0
for i in range(int(a[1])):
    j += 1
    s = int(a[0]) * j
    if s % int(a[1]) == int(a[2]):
        print('YES')
        d = 1
        break
if d == 0:
    print('NO')

Solution (Python):


a, b, c = map(int, input().split())
aa = a
lis = []
while True:
    aa = aa + a
    d = aa % b
    if b == 0 or d in lis:
        print("NO")
        exit()
    lis.append(d)
    if d == c:
        print("YES")
        exit()

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

s = set()
tmp = a
while True:
    if (tmp % b) in s:
        print("NO")
        break
    if tmp % b == c:
        print("YES")
        break

    s.add(a%b)
    tmp += a

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

Solution (Python):
import sys

a, b, c = map(int, sys.stdin.readline().split())

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

if __name__ == '__main__':
    ans = main()
    print(ans)

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

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

Solution (Python):
a, b, c = map(int, input().split())
rest = set([])
for i in range(a, 1000 * a, a):
    rest.add(i % b)
if c in rest:
    print('YES')
else:
    print('NO')

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

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

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

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

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

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

Solution (Python):
import fractions

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

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

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

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

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

for i in range(10000):
    t = a * i
    if t % b == c:
        print('YES')
        exit()

print('NO')

Solution (Python):

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

OK_list = []

for i in range(B):
    OK_list.append(A*i % B)

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

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

from fractions import gcd
g = gcd(a, b)
if g == 1:
    print('YES')
elif c % g == 0:
    print('YES')
else:
    print('NO')

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

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

Solution (Python):


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

yo=[0]*100

i=1
while True:
    temp=(A*i)%B
    if temp==C:
        print("YES")
        exit()
    else:
        if yo[temp]==0:
            yo[temp]=1
        else:
            print("NO")
            exit()
    i+=1

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

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

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

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

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

Solution (Python):
ABC = list(map(int,input().split()))
A=ABC[0]
B=ABC[1]
C=ABC[2]

cnt=1
summary=0
tmp=[]
flag=False
while True:
    summary=cnt*A
    cnt=cnt+1
    if summary%B in tmp:
        break
    else:
        tmp.append(summary%B)
    
    if summary%B==C:
        flag=True
        break

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

Solution (Python):
a,b,c = map(int, input().split())
ans=0
for i in range(101):
    if (a*i-c)%b==0:ans=1

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

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

def gcd(p, q):
    if q == 0:
        return(p)
    else:
        return gcd(q, p % q)
if c % gcd(a, b) == 0:
    print('YES')
else:
    print('NO')

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

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

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

Solution (Python):
def check():
    num = set()
    A,B,C = map(int, input().split())
    
    for i in range(B):
        amari = A*i % B
        if amari == C:
            return 'YES'
        if amari in num:
            break
        num.add(amari)
    return 'NO'
  
print(check())

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

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

print(ans)

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

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

print(Choose(A, B, C))

Solution (Python):
from sys import stdin

a,b,c = [int(x) for x in stdin.readline().rstrip().split()]

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

Solution (Python):


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

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

Solution (Python):
a, b, c = [int(i) for i in input().split()]
i = 1
mod = []
while True:
  m = a * i % b
  if m == c:
    print("YES")
    break
  if m in mod:
    print("NO")
    break
  mod.append(m)
  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")
        exit()
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 i ==B-1:
    print('NO')

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











import sys
sys.setrecursionlimit(10**6)
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
inf=float('inf')
mod = 10**9+7
def pprint(*A): 
    for a in A:     print(*a,sep='\n')
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    a,b,c = MI()
    d = a%b
    res = d
    for i in range(b**2):
        if c == res:
            print("YES")
            exit()
        res+=d
        res%=b
    print("NO")
    
if __name__ == '__main__':
    main()

Solution (Python):

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

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

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