import scala.io.StdIn

object Main extends App {
  val ary  = StdIn.readLine().split(" ").map(_.toByte)
  val tup3 = ary match {case Array(a:Byte, b:Byte, c:Byte) => (a, b, c)}

  if(isMatch(tup3, 1)) println("YES")
  else println("NO")

  def isMatch(ary: (Byte, Byte, Byte), n: Byte): Boolean = {
    val (a, b, c) = ary
    if(b <= n) false
    else if((a * n) % b == c ) true
    else isMatch(ary, (n + 1.toByte).toByte)
  }
}
