import Control.Applicative
import Control.Monad

f :: (Int, Int, Int) -> IO Bool
f (p, q, r)= do
  b <- forM [0..(q-1)] $ \i -> do
    if p*i `mod` q == r then return True
                        else return False
  return $ foldl (||) False b

main = do
  nums <- (\[x, y, z] -> (x, y, z)) . map read . words <$> getLine :: IO (Int, Int, Int)
  (f nums) >>= (\x -> if x then return "YES" else return "NO") >>= putStrLn
