solve :: Int -> Int -> Int -> String
solve a b c
  | cond = "YES"
  | otherwise = "NO"
    where
      cond = any (==c) $ map f [1..100]
      f i = i * a `mod` b

main = do
  [a,b,c] <- map read . words <$> getLine :: IO [Int]
  putStrLn $ solve a b c
