(defn create-data [s]
  (map #(Long/parseLong %) (.split s " ")))

(defn chooseIntegers [[a b c]]
  (if (empty? (for [i (range 0 a)
                  :when (zero? (mod (+ (* i b) c) a))]
              "YES")
            )
         "NO"
         "YES"
    )
  )


(println (chooseIntegers (create-data (read-line))))
