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

for i in range(10**6):

    if (i*b+c)%a==0:

        print("YES")

        exit()

print("NO")

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

tmp = 0

for i in range(1, b + 1):

    tmp = a * i

    if tmp % b == c:

        print("YES")

        exit()

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

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

-for i in range(10**6): -    if (i * b + c) % a == 0: +tmp = 0 +for i in range(1, b + 1): +    tmp = a * i +    if tmp % b == c: