import Data.List ( sort, nub )

solve a b c = try c $ life a b
  where
    life a b = nub . sort $ map (\n -> n * a `mod` b) [1..b]

    try c [0] = "NO"
    try c (0:n:_) = if c `mod` n == 0 then "YES" else "NO"

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