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



for i in range(1, 100):

    if a * i % b == c:

        print("YES")

        exit()



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



for i in range(1, 200):

    if a*i % b == c:

        print("YES")

        exit()

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

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

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