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

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

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

Solution (Python):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, acos, atan, asin
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 STR(): return input()
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 = sys.maxsize
mod = 10 ** 9 + 7

a, b, c = MAP()
d = gcd(a, b)
if c % d == 0:
    print('YES')
else:
    print('NO')

Solution (Python):
import sys

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

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

flg = 0

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

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

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

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

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

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

print('NO')

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

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

for i in range(1,101):
  if sum % B == C:
    print('YES')
    exit()
  else:
    cnt += 1
    num = A * cnt
    if num % B == C:
      print('YES')
      exit()
    sum += num
  
  if cnt == 100:
    print('NO')
    exit()

Solution (Python):
a, b, c = [int(x) for x in 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(B):
    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):
a, b, c = map(int, input().split())
baisuu = a
ans = "NO"
i = 0

while baisuu != a * b:
    if baisuu % b == c:
        ans = "YES"
        break
    else:
        i = i + 1
        baisuu = a * i

print(ans)

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






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

Solution (Python):
x,y,z=list(map(int, input().split()))

ans=0
chk=0
for i in range(x*y):
	ans=(ans+x)%y
	if ans==z:
		chk=1
if chk==1:
	print('YES')
else:
	print('NO')

Solution (Python):
A,B,C=map(int, input().split())
ans=[]
i = 1
while 1:
  x = A * i
  mod = x % B
  if mod == C:
    print("YES")
    exit()
  if mod in ans:
    print("NO")
    exit()
  ans.append(mod)
  i+=1

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

Solution (Python):
def f(A, B, C):
    ans = 'NO'
    for k in range(1, B + 1):
        if (k * A % B == C):
            ans = 'YES'
    return ans


if __name__ == "__main__":
    A, B, C = map(int, input().split())
    print(f(A, B, C))

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

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

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

Solution (Python):
import sys
sys.setrecursionlimit(10**6)
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
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
inf = float('inf')
ninf = -float('inf')
 

def ii(): return int(sys.stdin.readline().rstrip()) 
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) 
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]

def ss(): return sys.stdin.readline().rstrip() 
def mss(): return sys.stdin.readline().rstrip().split()
def limss(): return list(mss()) 
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]





a,b,c=mii()

chk=False

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

Solution (Python):












mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

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

if __name__=='__main__':
    main()

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

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

print("NO")

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

d = a % b
A = []

for i in range(1, 1000):
    e = (d * i) % b
    A.append(e)

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

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

Solution (Python):

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

l = []
bool = True
i = 0
while bool:
    l.append(a*i%b)
    i += 1
    if l[0] == l[-1] and len(l) != 1:
        bool = False
        
if l.count(c) > 0:
    print('YES')
else:
    print('NO')

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

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

print("NO")

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

i = 1
while a * i <= b ** 2:
    if (a * i) % b == c:
        print("YES")
        exit()
    i += 1

print("NO")

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

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

print(ans)

Solution (Python):
a,b,c = [int(x) for x in input().split()]



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

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

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

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

Solution (Python):
a, b, c = list(map(int,input().split()))
be_c =[]
ans = 0
for i in range(b):
    be_c.append(i*a)
for i in range(b):
    if be_c[i] != 0:
        if be_c[i] % b == c:
            print('YES')
            ans = 1
            break
        else:
            pass
    else:
        pass
if ans == 0:
    print('NO')

Solution (Python):












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

checklis = []
i = a
while not i in checklis:
    num = i % b
    if num == c:
        ans = "YES"
        break
    else:
        checklis.append(num)
        if num==0:
            checklis.append(i)
        i = num + a
else:
    ans = "NO"

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())
g = gcd(a, b)
if c % g:
    print('NO')
else:
    print('YES')

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

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

Solution (Python):
import sys
import os

MOD = 10 ** 9 + 7


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

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

    ret = 'NO'
    for n in range(100):
        if (A * n) % B == C:
            ret = 'YES'

    print(ret)


if __name__ == '__main__':
    main()

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

i = 0
while True:
    i = i+a
    if i%b == c:
        print("YES")
        break
    else:
        if i%b not in amalist:
            amalist.append(i%b)
        else:
            print("NO")
            break

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

Solution (Python):

a,b,c=map(int,input().split())
num=[]
i=1
n=a
while True:
    n=a*i
    x=n%b
    if x not in num:
        num.append(x)
    else:
        break
    i+=1

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

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

check = set([])

p = a
i = 1
while True:
    tmp = p%b

    if tmp == c:
        print("YES")
        exit()
    
    if tmp in check:
        print("NO")
        exit()
    check.add(tmp)
    i += 1
    p = a*i

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

Solution (Python):

import sys

YES = "YES"  
NO = "NO"  


def solve(A: int, B: int, C: int):
    a = A
    for _ in range(1000):
        if a%B == C:
            print(YES)
            return
        a += A

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

Solution (Python):








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

resolve()

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

from fractions import gcd
s = input().split()
t = [int(p) for p in s]


A = t[0]
B = t[1]
C = t[2]



Gcd = 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(b):
    res = (a * i) % b
    if res == c:
        break
if res == c:
    print('YES')
else:
    print('NO')

Solution (Python):
a,b,c = [int(i) for i in input().split()]
ans = 'NO'
for i in range(b):
  if (a+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())

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

print('NO')

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

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

    return print('NO')

if __name__ == '__main__':
    resolve()

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

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

Solution (Python):
a,b,c=[int(i) for i in input().split()]
if c in [(a*i)%b for i in range(b)]:
    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:
        print('YES')
        exit()

print('NO')

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

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

Solution (Python):

import sys


YES = "YES"  
NO = "NO"  


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


def solve(A: int, B: int, C: int):
    print(YES if C % gcd(A, B) == 0 else NO)


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


i=A
while i<=lcm:
  
  if i%B==C:
    print("YES")
    exit()
  i+=A
print("NO")

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

for i in range(1,100000):
  if (a*i)%b == c:
    print("YES")
    sys.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 l.count(c) != 0:
    print("YES")
else:
    print("NO")

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
from fractions import gcd

def main():
    mod=10**9+7
    a,b,c=MI()
    d=gcd(a,b)
    if c%d==0:
        print("YES")
    else:
        print("NO")

main()

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

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

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

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

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

Solution (Python):
a, b, c = map(int, input().split())
mod = []
cnt = 0
val = 0
while cnt == len(set(mod)):
    val += a
    mod.append(val % b)
    cnt += 1
    if val % b == c:
        print('YES')
        exit()
print('NO')

Solution (Python):
import sys

input = sys.stdin.readline


def read_values():
    return map(int, input().split())


def read_list():
    return list(read_values())


def func(N, mod):
    F = [1]
    for i in range(1, N + 1):
        F.append(F[-1] * i % mod)
    return F


def inv(a, mod):
    return pow(a, mod - 2, mod)


def C(F, a, b, mod):
    return F[a] * inv(F[b], mod) * inv(F[a - b], mod) % mod


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


if __name__ == "__main__":
    main()

Solution (Python):
import collections

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

def prime_factorize(n):
    arr = []
    while n % 2 == 0:
        arr.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            arr.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        arr.append(n)
    return arr
    
aa = collections.Counter(prime_factorize(a))
bb = collections.Counter(prime_factorize(b))

gcm = 1

if aa != []:
    for i in aa.keys():
        if i in bb.keys():
            gcm *= i ** (min([aa[i], bb[i]]))

if c % gcm == 0:
    print("YES")

else:
    print("NO")

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

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

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

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

print(result)

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

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

print(ans)

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

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

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

print(result)

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

for i in range(b):
    remainder.append((a*(i+1))%b)
    
print(["NO","YES"][c in remainder])

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

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

Solution (Python):

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

check = False
for s in range(200):
    if (a * s - c) % b == 0:
        print("YES")
        check = True
        break
if check == False:
    print("NO")

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

checker = {}
d = a
while(True):
    m = (d - c) % b
    checker.setdefault(m, False)
    
    if m == 0:
        print('YES')
        break
    elif checker[m]:
        print('NO')
        break
    else:
        checker[m] = True
        d += a

Solution (Python):

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

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

ans = "NO"

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

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

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

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

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



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

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

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

print("NO")

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

l=[]
for i in range(b):
    l.append((a*i)%b)
t=0
for i in range(len(l)):
    if l[i]==c:
        t+=1
        break
if t!=0:
    print("YES")
else:
    print("NO")

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

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

    print('NO')

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

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

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

def main():
    A, B, C = map(int, input().split())
    if C == 0 or A % B == C:
        print("Yes")
        sys.exit()
    rem = A % B
    i = 2
    ans = "NO"
    while True:
        if (A * i) % B == rem:
            break
        elif (A * i) % B == C:
            ans = "YES"
            break
        i += 1
    print(ans)

if __name__ == '__main__':
    main()

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

Solution (Python):
def main():
    a, b, c = [int(e) for e in input().split()]
    for ai in range(1, b + 1):
        if a*ai % b == c:
            print('YES')
            exit()

    print('NO')


if __name__ == "__main__":
    main()

Solution (Python):
def main():
    multiple_base, divisor, remainder = map(int, input().split())
    for i in range(multiple_base):
        if not (divisor * i + remainder) % multiple_base:
            print("YES")
            break
    else:
        print("NO")


if __name__ == '__main__':
    main()

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

s = set()
for i in range(1, b + 1):
    aa = a * i
    amari = aa % b
    if amari in s:
        break
    s.add(amari)

if c in s:
    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())

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

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

Solution (Python):

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


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

Solution (Python):
a, b, c = map(int, input().split())
x = a % b
w = x
p = {x}
while True:
    w = (w + x) % b
    if w in p:
        break
    else:
        p.add(w)
if c in p:
    print("YES")
else:
    print("NO")

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

a = 0
t = set()

while True:
    a += A
    a %= B
    if a in t:
        print('NO')
        break
    if a == C:
        print('YES')
        break
    t.add(a)

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

Solution (Python):
a, b, c = map(int, input().split(" "))
mod = a % b
if mod == c:
    print("YES")
else:
    mod_list = [mod]
    while True:
        mod_next = (mod + a) % b
        if mod_next in mod_list:
            print("NO")
            exit()
        else:
            if mod_next == c:
                print("YES")
                exit()
            else:
                mod_list.append(mod_next)
                mod = mod_next

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())
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,100000):
    if (a+(a*i))%b==c:
        print("YES")
        break
else:
    print("NO")

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

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

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

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

if d == -1:
    print("NO")

Solution (Python):

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

Solution (Python):
a, b, c= list(map(int, input().split()))
n = a
while n%b:
    if n%b==c:
        print('YES')
        exit()
    n += a
print('NO') if c else print('YES')

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

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

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

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

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

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

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

Solution (Python):
def gcd(x, y):
    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())

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())
d = a % b
e = []
for i in range(1,b):
    e.append(d*i % b)

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

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

Solution (Python):
def solve(a, b, c):

    def gcd(a, b):
        if a > b:
            a, b = b, a
        while a % b != 0:
            a, b = b, a % b
        return b

    return 'YES' if c % gcd(a, b) == 0 else 'NO'

_a, _b, _c = list(map(int, input().split()))
print(solve(_a, _b, _c))

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

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

print(ans)

Solution (Python):
a,b,c=map(int,input().split())
for x in range(10000):
    if a*x%b==c:
        print("YES")
        exit(0)
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 num in range(a,10**5,a):
    if num%b==c:
        print("YES")
        exit()
print("NO")

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

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

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

Solution (Python):
A, B, C = [int(x) for x in input().split()]
r_set = set()
i = 1
can = False
while True:
    r = A * i % B
    if r == C:
        can = True
        break
    else:
        if not r in r_set:
            r_set.add(r)
            i += 1
        else:
            break
print('YES') if can else print('NO')

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

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

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

Solution (Python):
A,B,C = map(int,input().split())
x=dict()
a=A
while(1):
    b = a%B
    if b in x:
        break
    else:
        x[b]=1
    a += A

for idx in x:
    if idx ==C:
        print("YES")
        exit()

print("NO")

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

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




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


if __name__ == "__main__":
    main()

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

print(ans)