module Main where

import Control.Applicative
import Control.Monad
import Data.List

check :: [[Int]] -> Bool
check (xs:xss) = all (f xs) xss
  where
    f xs ys = any (== xs) [fmap (+ n) ys | n <- [-100 .. 100]]

main :: IO ()
main = do
    css <- replicateM 3 $ fmap read . words <$> getLine :: IO [[Int]]
    if check css
        then putStrLn "Yes"
        else putStrLn "No"