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



for i in range(1, 101):

    if i * a % b == c:

        print("YES")

        exit()

else:

    print("NO")

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



for i in range(1, 100):

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

    print("YES")

    exit()

else:

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

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

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