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

x=1

data=set()

now=0

while x==1:

    now+=a

    now%=b

    if now==c:

        print('YES')

        break

    if now in data:

        print('NO')

        break

    data|={now,}
a,b,c=list(map(int,input().split()))

res='NO'

for i in range(1,b+1):

    if (a*i)%b==c:

        res='YES'

        break

print(res)
a, b, c = list(map(int, input().split()))
x = 1
data = set()
now = 0
while x == 1:
    now += a
    now %= b
    if now == c:
        print("YES")
        break
    if now in data:
        print("NO")
        break
    data |= {
        now,
    }

a, b, c = list(map(int, input().split()))
res = "NO"
for i in range(1, b + 1):
    if (a * i) % b == c:
        res = "YES"
        break
print(res)

-x = 1 -data = set() -now = 0 -while x == 1: -    now += a -    now %= b -    if now == c: -        print("YES") +res = "NO" +for i in range(1, b + 1): +    if (a * i) % b == c: +        res = "YES" -    if now in data: -        print("NO") -        break -    data |= { -        now, -    } +print(res)