from fractions import*;a,b,c=list(map(int,input().split()));print(('YNEOS'[c%gcd(a,b)>0::2]))
a,b,c=list(map(int,input().split()));print(('YNEOS'[all(a*i%b-c for i in range(99))::2]))
from fractions import *

a, b, c = list(map(int, input().split()))
print(("YNEOS"[c % gcd(a, b) > 0 :: 2]))

a, b, c = list(map(int, input().split()))
print(("YNEOS"[all(a * i % b - c for i in range(99)) :: 2]))

-from fractions import * - -print(("YNEOS"[c % gcd(a, b) > 0 :: 2])) +print(("YNEOS"[all(a * i % b - c for i in range(99)) :: 2]))