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

lis = list(range(1, 100000))

AA =0

for i in lis:

    AA = A*i

    if AA%B == C:

        print('YES')

        break

else:

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

for i in range(1, 500):

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

        print('YES')

        break

else:

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

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

-lis = list(range(1, 100000)) -AA = 0 -for i in lis: -    AA = A * i -    if AA % B == C: +for i in range(1, 500): +    if (A * i) % B == C: