# -*- coding utf-8 -*-



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

ans="NO"

for i in range(1000000):

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

        ans='YES'

        break

print(ans)

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

ans="NO"



for i in range (100000):

    if a*i%b==c:

        ans="YES"

        break



print(ans)

# -*- coding utf-8 -*-
a, b, c = list(map(int, input().split()))
ans = "NO"
for i in range(1000000):
    if (a * i - c) % b == 0:
        ans = "YES"
        break
print(ans)

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

-# -*- coding utf-8 -*- -for i in range(1000000): -    if (a * i - c) % b == 0: +for i in range(100000): +    if a * i % b == c: