(<=<) :: (Monad m) => (b -> m c) -> (a -> m b) -> (a -> m c)
f <=< g = \x -> g x >>= f

main :: IO ()
main = do
    _ <- getLine
    argLines <- lines <$> getContents
    let answers = map (\arg -> 
            let [step, x, y] = map read $ words arg
                tuple = (x,y)
            in  exec' step tuple) argLines
    if all (==True) answers
        then putStrLn "Yes"
        else putStrLn "No"

exec' :: Int -> (Int, Int) -> Bool
exec' num tuple = 
    let list = exec num (0,0)
    in tuple `elem` list

exec :: Int -> (Int, Int) -> [(Int, Int)]
exec num = foldr (<=<) return (replicate num move)

move :: (Int, Int) -> [(Int, Int)]
move (x, y) = do
    (x', y') <- [(x + 1, y), (x, y + 1), (x - 1, y), (x, y - 1)]
    return (x', y')