object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val A, B, C = sc.nextInt()

  @scala.annotation.tailrec
  def loop(count: Int, acc: List[Int]): Boolean = {
    val mod = (B * count + C) % A
    if (acc.contains(mod)) false
    else if (mod == 0) true
    else loop(count + 1, mod :: acc)
  }

  println(if (loop(1, List.empty)) "YES" else "NO")
}
