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

ans = "NO"

for x in range(b+1):

    if (a*x) % b == c:

        ans = "YES"

        break

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

ans = "NO"

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

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

        ans = "YES"

        break

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

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

-for x in range(b + 1): -    if (a * x) % b == c: +for i in range(1, b + 1): +    if (a * i) % b == c: