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



Sample input:
7 5 1


Sample output:
YES

Submission status: Accepted

Solution code:
A, B, C = map(int,input().split())
i = 1
while i <= B :
    if (i * A ) % B == C :
        break
    i = i + 1
if i == B + 1 :
    print("NO")
else :
    print("YES")

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
D = [0 for _ in range(B)]
for i in range(B):
    D[i] = (A * (i + 1)) % B
    if D[i] == C:
        ans = 'YES'
        break
    else:
        ans = 'NO'
print(ans)

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

Solution code:
int_a, int_b, int_c = map(int, input().split())

for i in range(1,int_b + 1):
    if int_a * i % int_b == int_c:
        print("YES")
        exit(0)
print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def abc060_b():
    a, b, c = map(int, input().split())
    for i in range(1, 101):
        if a * i % b == c:
            print("YES")
            return None
    print("NO")


abc060_b()

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
print("YES" if any((a*i)%b==c for i in range(1, b+1)) else "NO")
#コピペです。

Submission status: Accepted

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

Submission status: Accepted

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

mod = []
a = A
i = 1
while a*i % B not in mod:
    mod.append(a*i % B)
    i += 1
# ここまでAの倍数をBで割ったときに得られる余りを全てリストに追加した。

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

Submission status: Accepted

Solution code:
s=input().split();a=int(s[0]);b=int(s[1]);c=int(s[2]);pd=0
for i in range(0,1000):
    if a*i%b==c:
        print('YES')
        pd=1
        break
if pd==0:
    print('NO')

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import fractions

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

Submission status: Accepted

Solution code:
import fractions

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-


def main():
    """Function."""
    a, b, c = map(int, input().split())

    check = set()
    temp = a
    flag = 0
    while temp % b not in check:
        if c in check:
            flag = 1
            break
        else:
            check.add(temp % b)
            temp = temp + a

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


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a, b, c = [int(i) for i in input().split()]
# aの倍数の和をbで割ったあまりがc

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

Submission status: Accepted

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


def find_loop(x, mod):
    remainders = [x % mod]
    i = 1
    while True:
        i += 1
        r = (a * i) % b
        if r not in remainders:
            remainders.append(r)
        else:
            break
    return remainders


def judge(reminders, mod, c):
    result = [0]
    for rs in reminders:
        result = list({(x+r)%mod for x in result for r in rs})
    if c in result:
        return True
    return False


reminders = [find_loop(r, b) for r in find_loop(a, b)]
print('YES') if judge(reminders, b, c) else print('NO')

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split(" "))
l = []
for i in range(10000000):
  tmp = A*i%B
  if tmp in l:
    break
  l.append(tmp)
if C in l:
  print("YES")
else:
  print("NO")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B,C = [int(i) for i in input().split()]
# a = A % B
# if (C % a == 0) :
#     print("YES")
# else :
#     print("NO")

msg = "NO"
for a in range(1,100) :
    if ((a*A) % B ==C ):
        msg = "YES"
        break

print(msg)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())
A_ = A
counter = 0
while True:
    if A_%B == C:
        print("YES")
        break
    A_ += A
    counter += 1
    if counter > B:
        print("NO")
        break
#なんか知らんが動いた！
#go

Submission status: Accepted

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

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

else:
    print('NO')
    exit()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
A,B,C=map(int,input().strip().split(" "))

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

print("NO")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a,b,c=map(int,input().split())
i=0
l=[]
while True:
  i+=1
  m=(a*i-c)%b
  if m==0:
    print('YES')
    exit()
  if l.count(m):
    print('NO')
    exit()
  else:
    l.append(m)

Submission status: Accepted

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


def gcd(x, y):
    if x < y:
        return gcd(y, x)
    elif x % y == 0:
        return y
    else:
        return gcd(y, x % y)


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

Submission status: Accepted

Solution code:
a=list(map(int,input().split()))
flg=0
for i in range(a[1]):
    if a[0]*i % a[1] == a[2]:
        print("YES")
        flg=1
        break
if flg==0:
    print("NO")

Submission status: Accepted

Solution code:
# coding: utf-8
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)

Submission status: Accepted

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

P = max(A, B)
Q = min(A, B)
R = P % Q
while(R != 0):
    P = Q
    Q = R
    R = P % Q

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

Submission status: Accepted

Solution code:
a, b, c = list(map(int, input().split()))
flag = False

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
def gcd(x,y):
    p = max(x,y)
    q = min(x,y)
    while p % q != 0:
        r = p % q
        p = q
        q = r
    c = q
    return q
if c % gcd(a,b) == 0:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

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

print('NO')

Submission status: Accepted

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

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

print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def GCD(x, y):
    while(y != 0):
        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")

Submission status: Accepted

Solution code:
## ABC 060 b
import sys
a,b,c = (int(_) for _ in input().split())

m = []
n = 0
while(True):
    t = (a*n)%b
    if(t in m):
        print('NO')
        sys.exit()
    else:
        m.append(t)
    if(t == c):
        print('YES')
        sys.exit()
    n += 1

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
amari = list()
i = 1
while True:
    save = (a * i ) % b
    if save in amari:
        break
    amari.append(save)
    i += 1
    
if c in amari:
    print("YES")
else:
    print("NO")

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
A,B,C = (int(i) for i in input().split())

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

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

Submission status: Accepted

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

result = 'NO'
n = 1
f = A * n % B
m = f
while m != C:
    if 1 < n and m == f:
        break

    n += 1
    m = A * n % B


print('YES' if m == C else 'NO')

Submission status: Accepted

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

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

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

Submission status: Accepted

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

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

print('NO')

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def gcd(a,b):
    if b==0:return a
    else:return gcd(b, a%b)
a,b,c=map(int,input().split())
print('YNEOS'[c%gcd(a,-b)!=0::2])

Submission status: Accepted

Solution code:
#060-B
a,b,c=map(int,input().split())
for i in range(b):
    if a*i%b==c:
        print("YES")
        break
else:
    print("NO")

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
flag = False

for i in range(b):
  if i * a % b == c:
    flag = True
  else:
    pass

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

Submission status: Accepted

Solution code:
def gcd(m, n):
  if n == 0:
    return m
  
  return gcd(n, m % n)

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

Submission status: Accepted

Solution code:
a = list(map(int,input().split(" ")))
i = a[0]
count = 0
while i <= 10000:
    if i % a[1] == a[2]:
        count += 1
        break
    i += a[0]
if count >= 1:
    print("YES")
else:
    print("NO")

Submission status: Accepted

Solution code:
a, b, c = [int(s) for s in input().rstrip().split()]
judge = False
for m in range(1, b+1):
    if m * a % b == c:
        judge = True
ans = 'YES' if judge else 'NO'
print(ans)

Submission status: Accepted

Solution code:
A,B,C=map(int,input().split())
ini=A%B
tmp=ini
while(1):
  if(tmp==C):
    print("YES")
    break
  else:
    tmp+=ini
    tmp=tmp%B
    if(tmp==ini):
      print("NO")
      break

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
sum = 0
flag = 0
for i in range(1000):
    sum += A
    if sum % B == C:
        flag = 1

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from sys import stdin


def main() -> int:
    ans = "NO"
    a = next_int()
    b, c = map(int, input().split())

    x = a
    for i in range(b + 1):
        if x % b == c:
            ans = "YES"
            break
        x += a
    print(ans)
    return 0


def next_int() -> int:
    return int(next_str())


def next_str() -> str:
    result = ""
    while True:
        tmp = stdin.read(1)
        if tmp.strip() != "":
            result += tmp
        elif tmp != '\r':
            break
    return result


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

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

Submission status: Accepted

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

# a = a%b

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

print('NO')

Submission status: Accepted

Solution code:
from fractions import gcd
a, b, c = map(int, raw_input().split())
print ['NO', 'YES'][c % gcd(a, b) is 0]

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
A, B, C = map(int, input().split())
lis = list(range(1, 100000))
AA =0
for i in lis:
    AA = A*i
    if AA%B == C:
        print('YES')
        break
else:
    print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

abc_input = list(map(int, input().split()))
a = abc_input[0]
b = abc_input[1]
c = abc_input[2]

factor = gcd(a, b)

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
modL=[0]

while True:
    amari = (modL[len(modL)-1]+a)%b
    if amari == c:
        print("YES")
        break
    elif amari in modL:
        print("NO")
        break
    else:
        modL.append(amari)

Submission status: Accepted

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

Submission status: Accepted

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

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

print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


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


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


def comb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2, r + 1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p - 1, r, p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def bisearch(L, target):
    low = 0
    high = len(L) - 1
    
    while low <= high:
        mid = (low + high) // 2
        guess = L[mid]
        if guess == target:
            return True
        elif guess < target:
            low = mid + 1
        elif guess > target:
            high = mid - 1
    if guess != target:
        return False

# --------------------------------------------

dp = None


def main():
    A, B, C = li_input()

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


main()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
stdin = sys.stdin

def li(): return [int(x) for x in stdin.readline().split()]
def li_(): return [int(x)-1 for x in stdin.readline().split()]
def lf(): return [float(x) for x in stdin.readline().split()]
def ls(): return stdin.readline().split()
def ns(): return stdin.readline().rstrip()
def lc(): return list(ns())
def ni(): return int(ns())
def nf(): return float(ns())

# gcdを求める
def findGCD(a:int, b:int) -> int:
    # ユークリッドの互除法
    while 1:
        if a%b == 0:
            return b
        else:
            a = a%b
        
        if b%a == 0:
            return a
        else:
            b = b%a
            
a,b,c = li()
gcd = findGCD(a,b)

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

Submission status: Accepted

Solution code:
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")

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

rem_A = A % B

pass

for i in range(1, 101):
    sum_rem = rem_A * i
    if sum_rem % B == C:
        ans = 'YES'

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

X = set()

for i in range(1,101):
  X.add((A*i)%B)

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

Submission status: Accepted

Solution code:
A,B,C=map(int, input().split())
D=[A%B]

for i in range(2,B+1):
    D.append((D[0]*i)%B)
    if C in D:
        print("YES")
        exit()
print("NO")

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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')

Submission status: Accepted

Solution code:
#60b
a,b,c =map(int,input().split())
i=0
aa=a
while i<b:
    i+=1
    if aa%b == c:
        print('YES')
        exit()
    aa+=a
print('NO')

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())
i =0
AA = A
while i <B:
    i+=1
    if AA%B ==C:
        print('YES')
        exit()
    AA += A
print('NO')

Submission status: Accepted

Solution code:
A, B, C = [int(i) for i in input().split()]
num = 0
apperedNum = []
ans = "NO"

while(True):
    num += A
    remain = num % B
    if remain == C:
        ans = "YES"
        break
    elif remain in apperedNum:
        break
    apperedNum.append(remain)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a, b, c = map(int, input().split())
i = 1
while a * i <= a * b:
    if a * i % b == c:
        print('YES')
        exit()
    i += 1
print('NO')

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#-*-coding:utf-8-*-

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#-*-coding:utf-8-*-

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
a, b, c = [int(v) for v in input().split()]
ans = False
for i in range(1, b+1):
    if a * i % b == c:
        ans = True
        break

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import defaultdict
import sys,heapq,bisect,math,itertools,string
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
AtoZ = [chr(i) for i in range(65,65+26)]
atoz = [chr(i) for i in range(97,97+26)]

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

#最大公約数
def gcd(a,b):
	while b:
		a,b = b, a%b
	return a

#最小公倍数
def lcm(a,b):
	return a*b // gcd(a,b)


p = gcd(a,b)

if c % p == 0:
	print('YES')
else:
	print('NO')

Submission status: Accepted

Solution code:
A,B,C = map(int,input().split())
i =0
AA = A
while i <B:
    i+=1
    if AA%B ==C:
        print('YES')
        exit()
    AA += A
print('NO')

Submission status: Accepted

Solution code:
import fractions as f
a,b,c=map(int,input().split())
print('NO' if c%f.gcd(a,b) else 'YES')

Submission status: Accepted

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