import Control.Applicative

main :: IO ()
main = do
    [a, b] <- map read . words <$> getLine
    putStrLn $  solve a b
    
solve :: Int -> Int -> String 
solve a b = if mod a b == 0 then "0" else "1"