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 = list(map(int, input().split()))

s = 1
if A < B:
    s = B//A + 1
syo = A*s % B   
if s != 1:
    syo2 = A*(s - 1) % B - B
    syo += syo2
if syo == 0 and C == 0:
    print("YES")
elif syo == 0:
    print("NO")
else:
    flag = 0
    for i in range(1,97*93):
        if syo*i % B == C:
            print("YES")
            flag = 1
            break
    if flag == 0:
        print("NO")

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

def check():
    for i in range(1000000):
        if (A * i) % B == C:
            return 'YES'
    return 'NO'
    
print(check())

Solution (Python):
nums = list(map(int,input().split()))
a = nums[0]
b = nums[1]
c = nums[2]
x = [i*a for i in range(100) if i*a % b == c ]
if len(x) != 0 :
    print("YES")
else:
    print("NO")

Solution (Python):


a,b,c = map(int, input().split())
rem = -1
flag = False
for i in range(1, b):
    rem = (a * i) % b
    if rem == c:
        flag = True
if flag:
    print("YES")
else:
    print("NO")

Solution (Python):


import sys

def main(argv):
    for line in sys.stdin:
        a, b, c = map(lambda x: int(x), line.split(" ", 3))
        p = a % b
        q = c % b

        if p == q:
            print("YES")
        elif p == 0:
            print("NO")
        else:
            candidates = []
            i = 1
            candidate = (i * a) % b
            while not candidate in candidates:
                if candidate == q:
                    break
                candidates.append(candidate)

                i += 1
                candidate = (i * a) % b

            if candidate == q:
                print("YES")
            else:
                print("NO")

if __name__ == "__main__":
    main(sys.argv)

Solution (Python):
def choose_intenger(s):
    a, b, c = map(int, s.split())
    for i in range(b):
        if ( a + a*i ) % b == c:
            print("YES")
            return 

    print("NO")


choose_intenger(input())

Solution (Python):

import sys

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

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

print("NO")

Solution (Python):
x=raw_input().split(" ")
x=map(int,x)

flag=1
for i in range(1,101):
	if(x[0]*i)%x[1]==x[2]:
		print "YES"
		flag = 0
		break
if(flag==1):
	print "NO"

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

judge = 0
for i in range(B):
    if C == A*i % B:
        judge = 1

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

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

Solution (Python):


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

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

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

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

A = int(A)
B = int(B)
C = int(C)

resulting = C % B

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

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

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

Solution (Python):

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

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

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

m = []
i = 0
while(True):
  i += 1
  r = (A*i) % B

  if(r in m):
    break
  m.append(r)

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

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

n = A % B
if n == 0:
    print('NO')
else:
    f = n
    i = 2
    l = [f]
    while True:
        n = (i * f) % B
        i += 1
        l.append(n)
        if n == f:
            break
    if C in set(l):
        print('YES')
    else:
        print('NO')

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

    table = set()
    x = 1
    while True:
        mod = (a * x) % b
        if mod in table: break

        table.add(mod)
        x += 1

    ans = "YES" if c in table else "NO"
    print(ans)

Solution (Python):

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

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

count = int(b/gcd(a,b))
flag = 0

for i in range(count):
    if (a*i) % b == c:
        flag = 1
        break

if flag == 0:
    print("NO")

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

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

if __name__ == '__main__':
    main()

Solution (Python):




import numpy as np
import itertools

def gcd(x, y):
    if x == y:
        return x
    elif x > y:
        return gcd(x-y, y)
    else:
        return gcd(y-x, x)

A, B, C = map(int, raw_input().split())
if (C % gcd(A, B)) == 0:
    print "YES"
else:
    print "NO"

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

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

surplus = []
for i in range(100):
    surplus.append((A*(i+1))%B)

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

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

for x in range(1,101):
    for y in range(1,101):
        if A*x % B*y == C:
            print("YES")
            sys.exit()
else:
    print("NO")

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

sample = 0
c = []
while True:
    sample += A
    if (sample % B) == C:
        print("YES")
        break
    if (sample % B) in c:
        print("NO")
        break
    c.append(sample % B)

Solution (Python):
import sys

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

a = int(a)
b = int(b)
c = int(c)

d = a % b
e = d
while True:
    e = (e + d) % b
    if e == c:
        print('YES')
        break
    if e == d:
        print('NO')
        break

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

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

Solution (Python):
A,B,C=map(int,raw_input().split())
ok=False
for i in range(1,1000):
    if (A*i-C)%B==0:
        ok=True

if ok:
    print "YES"
else:
    print "NO"

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

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

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

Solution (Python):


a,b,c = map(int, raw_input().split())
num = a
cnt = 0
check = []
while(not(num%b in check)):
    if(num%b == c):
        print('YES')
        exit()        
    check.append(num%b)
    num += a
    cnt += 1  
print('NO')

Solution (Python):
import sys

A,B,C=map(int,raw_input().split(' '))


o=A

a=[]

while not(A%B in a):
    if A%B==C:
        print "YES"
        sys.exit()
    a.append(A%B)
    A+=o

print "NO"

Solution (Python):





mozir=input()
hyo=mozir.split(' ')
A=int(hyo[0])
B=int(hyo[1])
C=int(hyo[2])

ans=False
for idx in range(0,B,1):
    amari= idx*A % B
    if amari == C:
        ans = True
        break

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

Solution (Python):


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

if __name__ == '__main__':
    a, b, c = map(int, input().split())
    if a == 1:
        print("YES")
    else:
        solve()

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

mod_list = []
i = 1
while True:
    mod = (A * i) % B
    if mod in mod_list:
        break
    mod_list.append(mod)
    i += 1

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

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

    if C == 0:
        print("YES")
        return

    D = set()
    for b in range(1, B):
        D.add((A*b)%B)

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


if __name__ == "__main__":
    main()

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

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

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

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

m = []
m.append(a % b)
n = 2
while(a * n % b not in m):
    m.append(a * n % b)
    n += 1

if c not in m:
    print("NO")
else:
    print("YES")

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

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

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

n = 0
while n < 10**6:
    if (n*a - c) % b == 0:
        print "YES"
        break
    n += 1
else:
    print "NO"

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

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

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