open Batteries
let () =
  let a,b,c = Scanf.scanf "%d %d %d " (fun a b c -> a,b,c) in

  let res = ref "NO" in
  for i=1 to b do
    if a*i mod b = c then res := "YES"
  done;

  Printf.printf "%s\n" !res
