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





for i in range(10000):

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

        print("YES")

        exit()



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





for i in range(b):

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

        print("YES")

        exit()



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

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

-for i in range(10000): +for i in range(b):