main = do
  line <- getLine
  let input = words line
  let a = read (input!!0) :: Int
  let b = read (input!!1) :: Int
  let c = read (input!!2) :: Int
  putStrLn $ if elem c [(a * x) `mod` b | x <- [1..1000]] then "YES" else "NO"