def resolve():

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

	ans = "NO"

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

		if i*a % b == c:

			ans = "YES"

			break

	print(ans)

resolve()
from fractions import gcd



def ngcd(nums):

	n = 0

	for i in nums:

		n = gcd(n, i)

	return n



def resolve():

	nums = list(map(int, input().split()))

	t = ngcd(nums)

	if t != 1:

		nums = [int(i/t) for i in nums]

	if gcd(nums[0], nums[1]) == 1:

		print("YES")

	else:

		print("NO")

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


resolve()

from fractions import gcd


def ngcd(nums):
    n = 0
    for i in nums:
        n = gcd(n, i)
    return n


def resolve():
    nums = list(map(int, input().split()))
    t = ngcd(nums)
    if t != 1:
        nums = [int(i / t) for i in nums]
    if gcd(nums[0], nums[1]) == 1:
        print("YES")
    else:
        print("NO")


resolve()

+from fractions import gcd + + +def ngcd(nums): +    n = 0 +    for i in nums: +        n = gcd(n, i) +    return n + + -    a, b, c = list(map(int, input().split())) -    ans = "NO" -    for i in range(1, b + 1): -        if i * a % b == c: -            ans = "YES" -            break -    print(ans) +    nums = list(map(int, input().split())) +    t = ngcd(nums) +    if t != 1: +        nums = [int(i / t) for i in nums] +    if gcd(nums[0], nums[1]) == 1: +        print("YES") +    else: +        print("NO")