solve :: (Int, Int) -> Int -> [(Int, Int)] solve t 0 = [t] solve (x, y) n = concat [solve (x+(fst d), y+(snd d)) (n-1) | d <- [(0,0),(-2,-1),(-2,1),(-1,-2),(-1,2),(1,-2),(1,2),(2,-1),(2,1)]] main = do [x, y] <- return . map read . words =<< getLine putStrLn $ if elem (x, y) (solve (0, 0) 3) then "YES" else "NO"