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



for k in range(1,101):

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

        print("YES")

        exit(0)

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

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

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

        print("YES")

        exit(0)

print("NO")

A, B, C = list(map(int, input().split()))
for k in range(1, 101):
    if (A * k) % B == C:
        print("YES")
        exit(0)
print("NO")

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

-for k in range(1, 101): +for k in range(1, B + 1):