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-----
7 5 1

-----Sample Output-----
YES

For example, if you select 7 and 14, the sum 21 is congruent to 1 modulo 5.

Difficulty: EASY

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


(a, b, c) = map(int, input().split())
for k in range(1, 10001):
	if (k * a - c) % b == 0:
		print('YES')
		exit()
print('NO')


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


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


(a, b, c) = map(int, input().split())
print(['NO', 'YES'][c in set((a * i % b for i in range(1, 10000)))])


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


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


def g(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
(a, b, c) = map(int, input().split())
print(['NO', 'YES'][c % g(a, b) == 0])


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


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


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


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


(a, b, c) = map(int, input().split())
x = []
for i in range(b):
	x.append(a * -~i % b)
print('YNEOS'[c not in x::2])


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


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


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


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


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


from sys import stdin, stdout

def solve():
	(a, b, c) = list(map(int, input().split()))
	possible = False
	for k in range(b):
		if (a * k - c) % b == 0:
			possible = True
			break
	if possible:
		print('YES')
	else:
		print('NO')

def main():
	solve()

def __starting_point():
	main()
__starting_point()


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


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


(a, b, c) = map(int, input().split())
l = max(a, b)
s = min(a, b)
while s != 0:
	(l, s) = (s, l % s)
print('NO' if c % l != 0 else 'YES')


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


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


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


import copy
(a, b, c) = map(int, input().split())
x = copy.deepcopy(a)
visited = [False] * (b + 1)
flg = True
while True:
	x %= b
	if x == c:
		break
	elif visited[x]:
		flg = False
		break
	else:
		visited[x] = True
		x += a
print('YES') if flg else print('NO')


(a, b, c) = map(int, input().split())
for i in range(b):
	if a * i % b == c:
		print('YES')
		break
	elif a * i % b == 0 and i > 0:
		print('NO')
		break


from fractions import *
(A, B, C) = map(int, input().split())
print('YNEOS'[C % gcd(A, B) > 0::2])


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


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


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


def answer(a: int, b: int, c: int) -> str:
	for i in range(1, b + 1):
		if a * i % b == c:
			return 'YES'
	return 'NO'

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

def __starting_point():
	main()
__starting_point()


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


ans = 'NO'
(a, b, c) = map(int, input().split())
memo = []
for i in range(1, 10 ** 9):
	tmp = a * i % b
	if tmp == c:
		ans = 'YES'
		break
	if tmp in memo:
		break
	else:
		memo.append(tmp)
print(ans)


(A, B, C) = list(map(int, input().split()))
calc = 0
for i in range(1000):
	calc += A
	rem = calc % B
	if rem == C:
		print('YES')
		return
print('NO')


(A, B, C) = map(int, input().split())
mod = []
for i in range(max(B, C)):
	res = A * i % B
	if res == C:
		ans = 'YES'
		break
	if res in mod:
		ans = 'NO'
		break
	mod.append(res)
print(ans)


(a, b, c) = map(int, input().split())
n = a
cnt = 1
while cnt <= b:
	if n % b == c:
		print('YES')
		return
	cnt += 1
	n += a
print('NO')


(A, B, C) = map(int, input().split())
r = [A * k % B for k in range(B)]
print(['NO', 'YES'][C in r])


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


import re
import copy

def accept_input():
	(a, b, c) = list(map(int, input().split()))
	return (a, b, c)
(a, b, c) = accept_input()
aamari = a % b
amaridict = {}
curamari = a % b
for i in range(b):
	curamari = (curamari + aamari) % b
	amaridict[curamari] = 1
if c in amaridict:
	print('YES')
else:
	print('NO')


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


(A, B, C) = map(int, input().split())
ans = 'NO'
i = 1
while i <= B:
	if i * A % B == C:
		ans = 'YES'
	i += 1
print(ans)


(A, B, C) = map(int, open(0).read().split())
print('YES' if any((A * i % B == C for i in range(1, B + 1))) else 'NO')


(A, B, C) = map(int, input().split())
mod = set()
tmp = 0
D = A
while tmp not in mod:
	mod.add(tmp)
	tmp = D % B
	if tmp == C:
		print('YES')
		return
	D += A
print('NO')


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


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


(a, b, c) = map(int, input().split())
A = []
for i in range(1, b + 1):
	mod = a * i % b
	if mod in A:
		break
	A.append(mod)
A.sort()
if len(A) >= 2:
	i = A[1]
else:
	i = 0
if i == 0 and c == 0:
	print('YES')
	return
elif i == 0 and c != 0:
	print('NO')
	return
if c % i == 0:
	print('YES')
else:
	print('NO')


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


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


from math import gcd
numbers = list(map(lambda x: int(x), input().split()))
(a, b, c) = (numbers[0], numbers[1], numbers[2])
print('YES') if not c % gcd(a, b) else print('NO')


(A, B, C) = list(map(int, input().split()))
s = 0
for i in range(1, B + 1):
	x = A * i % B
	if x == C:
		s = s + 1
	else:
		s = s
if s != 0:
	print('YES')
else:
	print('NO')


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


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


(A, B, C) = map(int, input().split())
print(['NO', 'YES'][any([A * i % B == C for i in range(1, B + 1)])])


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


lst = input().split()
A = int(lst[0])
B = int(lst[1])
C = int(lst[2])
L = []
for i in range(1, B + 1):
	L.append(A * i % B)
if C in L:
	print('YES')
else:
	print('NO')


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


(a, b, c) = map(int, input().split())
d = a % b
s = set()
while d not in s:
	s.add(d)
	d = (d + a) % b
if c in s:
	print('YES')
else:
	print('NO')


import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
from functools import reduce
rr = lambda : sys.stdin.readline().rstrip()
rs = lambda : sys.stdin.readline().split()
ri = lambda : int(sys.stdin.readline())
rm = lambda : list(map(int, sys.stdin.readline().split()))
rl = lambda : list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10 ** 9 + 7
(a, b, c) = rm()
len_ = 1
s = set()
s.add(a)
i = a
while len_ == len(s):
	i += a
	i %= b
	len_ += 1
	s.add(i)
for i in list(s):
	if i == c:
		print('YES')
		return
else:
	print('NO')


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


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


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


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


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

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


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


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

def gcd(a, b):
	while b:
		(a, b) = (b, a % b)
	return a
if A == 1:
	print('YES')
elif C % gcd(A, B) == 0:
	print('YES')
else:
	print('NO')


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


def __starting_point():
	(a, b, c) = map(int, input().split())
	for i in range(1000000):
		m = a * i % b
		if m == c:
			print('YES')
			return
	print('NO')
__starting_point()


(A, B, C) = [int(s) for s in input().split()]
print('YNEOS'[C not in [A * (i + 1) % B for i in range(B)]::2])


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


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


(a, b, c) = map(int, input().split())
s = [a * i for i in range(1, b + 1) if a * i % b == c]
print('YES' if len(s) > 0 else 'NO')


import sys
import copy
import math
import itertools
import numpy as np
(A, B, C) = [int(c) for c in input().split()]
a = []
cnt = 0
while True:
	cnt += A
	a.append(cnt % B)
	if C == cnt % B:
		print('YES')
		return
	elif a.count(cnt % B) > 1:
		print('NO')
		return


(a, b, c) = map(int, input().split())
A = {k * a % b for k in range(b)}
print('YES' if c in A else 'NO')


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


(a, b, c) = map(int, input().split())
ganma = a % b
if ganma == 0:
	if ganma == c:
		print('YES')
	else:
		print('NO')
else:
	mod_list = []
	for i in range(b):
		mod = i * ganma % b
		mod_list.append(mod)
	zero_one_list = []
	for i in range(b):
		if mod_list[i] == c:
			zero_one_list.append(1)
		else:
			zero_one_list.append(0)
	sum_list = sum(zero_one_list)
	if sum_list >= 1:
		print('YES')
	else:
		print('NO')


(A, B, C) = map(int, input().split())
dp = [0] * 1000
ans = 'NO'
cur_A = A
while 1:
	if cur_A % B == C:
		ans = 'YES'
		break
	elif dp[cur_A % B] == 1:
		ans = 'NO'
		break
	dp[cur_A % B] = 1
	cur_A += A
print(ans)


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


(A, B, C) = map(int, input().split(' '))
mod = []
pivot = 1
step = 1
while True:
	pivot = step * A % B
	if step * A % B == C:
		print('YES')
		break
	elif pivot in mod:
		print('NO')
		break
	else:
		mod.append(pivot)
		step = step + 1


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


(a, b, c) = map(int, input().split())
hist = []
ans = 'NO'
for i in range(1, b + 1):
	mod = a * i % b
	if mod == c:
		ans = 'YES'
		break
	elif mod in hist:
		break
	hist.append(mod)
print(ans)