fun main(args: Array<String>) = yorukatsu22b()

fun yorukatsu22b() {
    val (a, b, c) = readLine()!!.split(' ').map { it.toInt() }

    val remains = mutableSetOf<Int>()
    var i = 1

    while (remains.add(a * i++ % b)) Unit

    val answer = if (c in remains) "YES" else "NO"

    println(answer)
}
