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



i = 1

while i <= b:

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

        print("YES")

        exit()

    i += 1



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



for i in range(1, 101):

    if a * i % b == c:

        print("YES")

        exit()

else:

    print("NO")
a, b, c = list(map(int, input().split()))
i = 1
while i <= b:
    if (a * i) % b == c:
        print("YES")
        exit()
    i += 1
print("NO")

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

-i = 1 -while i <= b: -    if (a * i) % b == c: +for i in range(1, 101): +    if a * i % b == c: -    i += 1 -print("NO") +else: +    print("NO")