a, b, c = list(map(int, input().split()))

d = []

for i in range(b):

    d.append(a * (i + 1) % b)

d = set(d)

if c in d:

    print('YES')

else:

    print('NO')

a, b, c = list(map(int, input().split()))

R = [(a * i) % b for i in range(b)]

if c in R:

    print('YES')

else:

    print('NO')
a, b, c = list(map(int, input().split()))
d = []
for i in range(b):
    d.append(a * (i + 1) % b)
d = set(d)
if c in d:
    print("YES")
else:
    print("NO")

a, b, c = list(map(int, input().split()))
R = [(a * i) % b for i in range(b)]
if c in R:
    print("YES")
else:
    print("NO")

-d = [] -for i in range(b): -    d.append(a * (i + 1) % b) -d = set(d) -if c in d: +R = [(a * i) % b for i in range(b)] +if c in R: