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



D=[]





for n in range(1, 10000):



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

        D.append("Y")   

        

if len(D)>0:

    print("YES")

else:

    print("NO")

    

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



for i in range(100):

    if A*i%B==C:

        print("YES")

        break

        

else:

    print("NO")
a, b, c = list(map(int, input().split()))
D = []
for n in range(1, 10000):
    if ((a * n) % b) == c:
        D.append("Y")
if len(D) > 0:
    print("YES")
else:
    print("NO")

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

-a, b, c = list(map(int, input().split())) -D = [] -for n in range(1, 10000): -    if ((a * n) % b) == c: -        D.append("Y") -if len(D) > 0: -    print("YES") +A, B, C = list(map(int, input().split())) +for i in range(100): +    if A * i % B == C: +        print("YES") +        break