output_description: Print `YES` or `NO`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      A B C
attempt: #!/usr/bin/env python3
  from collections import defaultdict
  from collections import deque
  from heapq import heappush, heappop
  import sys
  import math
  import bisect
  import random
  import itertools
  
  sys.setrecursionlimit(10**5)
  stdin = sys.stdin
  bisect_left = bisect.bisect_left
  bisect_right = bisect.bisect_right
  
  
  def LI():
      return list(map(int, stdin.readline().split()))
  
  
  def LF():
      return list(map(float, stdin.readline().split()))
  
  
  def LI_():
      return list(map(lambda x: int(x) - 1, stdin.readline().split()))
  
  
  def II():
      return int(stdin.readline())
  
  
  def IF():
      return float(stdin.readline())
  
  
  def LS():
      return list(map(list, stdin.readline().split()))
  
  
  def S():
      return list(stdin.readline().rstrip())
  
  
  def IR(n):
      return [II() for _ in range(n)]
  
  
  def LIR(n):
      return [LI() for _ in range(n)]
  
  
  def FR(n):
      return [IF() for _ in range(n)]
  
  
  def LFR(n):
      return [LI() for _ in range(n)]
  
  
  def LIR_(n):
      return [LI_() for _ in range(n)]
  
  
  def SR(n):
      return [S() for _ in range(n)]
  
  
  def LSR(n):
      return [LS() for _ in range(n)]
  
  
  mod = 1000000007
  inf = float("INF")
  
  
  # A
  def A():
      a, b, c = LS()
      if a[-1] == b[0] and b[-1] == c[0]:
          print("YES")
      else:
          print("NO")
      return
  
  
  # B
  def B():
      a, b, c = LI()
      for i in range(1, b):
          if a * i % b == c:
              print("YES")
              return
      print("NO")
      return
  
  
  # C
  def C():
      return
  
  
  # D
  def D():
      return
  
  
  # Solve
  if __name__ == "__main__":
      B()
  
problem_description: Statement
  
  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`.
samples: [{"input": "7 5 1", "output": "YES\n    \n\nFor example, if you select 7 and 14, the sum 21 is congruent to 1 modulo 5.\n\n* * *"}, {"input": "2 2 1", "output": "NO\n    \n\nThe sum of even numbers, no matter how many, is never odd.\n\n* * *"}, {"input": "1 100 97", "output": "YES\n    \n\nYou can select 97, since you may select multiples of 1, that is, all integers.\n\n* * *"}, {"input": "40 98 58", "output": "YES\n    \n\n* * *"}, {"input": "77 42 36", "output": "NO"}]