open Printf
open Scanf

let rec gcd m n =
  if n = 0 then m
  else gcd n (m mod n)

let lcm m n = m * n / (gcd m n)
            
let () =
  let a, b, c = scanf "%d %d %d\n" (fun x y z -> (x, y, z)) in
  let rec check s t =
    if s > t then "NO"
    else if s mod b = c then "YES"
    else check (s + a) t in
  check a (lcm a b) |> printf "%s\n"
