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

flag = 0

for i in range(B):

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

        flag = 1

        break

if flag==1:

    print("YES")

else:

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

flag = 0

for k in range(B):

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

        flag = 1

        break

if flag==1:

    print("YES")

else:

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

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

-for i in range(B): -    if (i * A) % B == C: +for k in range(B): +    if (k * A) % B == C: