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



result = "NO"

for i in range(1, 1000):

    if a * i % b == c:

        result = "YES"

        break

print(result)

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



result = "NO"

for i in range(1, 100):

    if a * i % b == c:

        result = "YES"

print(result)

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

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

-for i in range(1, 1000): +for i in range(1, 100): -        break