A,B,C = (int(i) for i in input().split())



dekiru = False

for i in range(B):

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

        dekiru = True



if dekiru:

    print("YES")

else:

    print("NO")
A,B,C = (int(i) for i in input().split())



dividable = False

for i in range(B):

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

        dividable = True



if dividable:

    print("YES")

else:

    print("NO")
A, B, C = (int(i) for i in input().split())
dekiru = False
for i in range(B):
    if (A * (i + 1)) % B == C:
        dekiru = True
if dekiru:
    print("YES")
else:
    print("NO")

A, B, C = (int(i) for i in input().split())
dividable = False
for i in range(B):
    if A * (i + 1) % B == C:
        dividable = True
if dividable:
    print("YES")
else:
    print("NO")

-dekiru = False +dividable = False -    if (A * (i + 1)) % B == C: -        dekiru = True -if dekiru: +    if A * (i + 1) % B == C: +        dividable = True +if dividable: