main = do [n,m] <- map read . words <$> getLine let (q,r) = divMod n m if r==0 then print q else print (-1)