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

import fractions

c = fractions.gcd(A,B)

ans = 'NO'

if C % c == 0:

  ans = 'YES'

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

import fractions

a = fractions.gcd(A, B)

ans = 'NO'

if a == 1:

  ans = 'YES'

elif C % a == 0:

  ans = 'YES'

print(ans)
A, B, C = list(map(int, input().split()))
import fractions

c = fractions.gcd(A, B)
ans = "NO"
if C % c == 0:
    ans = "YES"
print(ans)

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

a = fractions.gcd(A, B)
ans = "NO"
if a == 1:
    ans = "YES"
elif C % a == 0:
    ans = "YES"
print(ans)

-c = fractions.gcd(A, B) +a = fractions.gcd(A, B) -if C % c == 0: +if a == 1: +    ans = "YES" +elif C % a == 0: