We ask you to select some number of positive integers, and calculate the sum of them.  It is allowed to select as many integers as you like, and as large integers as you wish. You have to follow these, however: each selected integer needs to be a multiple of A, and you need to select at least one integer.  Your objective is to make the sum congruent to C modulo B. Determine whether this is possible.  If the objective is achievable, print `YES`. Otherwise, print `NO`.
a, b, c = list(map(int,input().split()))
be_c =[]
ans = 0
for i in range(b):
    be_c.append(i*a)
for i in range(b):
    if be_c[i] != 0:
        if be_c[i] % b == c:
            print('Yes')
            ans = 1
            break
        else:
            pass
    else:
        pass
if ans == 0:
    print('No')
a, b, c = list(map(int,input().split()))
be_c =[]
ans = 0
for i in range(b):
    be_c.append(i*a)
for i in range(b):
    if be_c[i] != 0:
        if be_c[i] % b == c:
            print('YES')
            ans = 1
            break
        else:
            pass
    else:
        pass
if ans == 0:
    print('NO')