from fractions import gcd

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

if C % gcd(A, B) == 0:

	print("YES")

else:

	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")

from fractions import gcd

A, B, C = list(map(int, input().split()))
if C % gcd(A, B) == 0:
    print("YES")
else:
    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")

-from fractions import gcd - -if C % gcd(A, B) == 0: -    print("YES") -else: -    print("NO") +for i in range(B): +    if (A * i) % B == C: +        print("YES") +        exit() +print("NO")