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

a=[A*(i+1)%B for i in range(B)]

if C in a:

    print('YES')

else:

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

for i in range(B):

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

        print("YES")

        exit()

print("NO")
A, B, C = list(map(int, input().split()))
a = [A * (i + 1) % B for i in range(B)]
if C in a:
    print("YES")
else:
    print("NO")

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

-a = [A * (i + 1) % B for i in range(B)] -if C in a: -    print("YES") -else: -    print("NO") +for i in range(B): +    if A * (i + 1) % B == C: +        print("YES") +        exit() +print("NO")