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

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

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