A ,B ,C = list(map(int,input().split()))



for i in range(100):

    if (A * i) % B == C:

        print("YES")

        quit()

print("NO")

A ,B ,C = list(map(int,input().split()))



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

    if (A * i) % B == C:

        print("YES")

        quit()

print("NO")

A, B, C = list(map(int, input().split()))
for i in range(100):
    if (A * i) % B == C:
        print("YES")
        quit()
print("NO")

A, B, C = list(map(int, input().split()))
for i in range(1, B + 1):
    if (A * i) % B == C:
        print("YES")
        quit()
print("NO")

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