{-# LANGUAGE OverloadedLists     #-}
{-# LANGUAGE OverloadedStrings   #-}
{-# LANGUAGE ScopedTypeVariables #-}

import           Control.Monad
import           Data.IORef
import           Data.Maybe
import qualified Data.Text     as T
import qualified Data.Text.IO  as T
import           GHC.Base
import           System.IO

import qualified Data.Array    as A
import qualified Data.IntMap   as I
import           Data.List
import qualified Data.Map      as M
import qualified Data.Set      as S
import qualified Data.Vector   as V

-- for IO
readT :: Read a => T.Text -> a
readT = read . T.unpack

getLineSpc :: Read a => IO [a]
getLineSpc = do
  t <- T.getLine
  let xs = map readT $ T.split (== ' ') t
  return xs

-- main
main :: IO ()
main = takahashisInformation

takahashisInformation :: IO ()
takahashisInformation = do
  [c11, c12 ,c13] :: [Int] <- getLineSpc
  [c21, c22 ,c23] :: [Int] <- getLineSpc
  [c31, c32 ,c33] :: [Int] <- getLineSpc
  let c2111 = c21 - c11
      c3111 = c31 - c11
      cond1 = c2111 == c22 - c12 && c2111 == c23 - c13
      cond2 = c3111 == c33 - c13 && c3111 == c32 - c12
  if cond1 && cond2
    then
    putStrLn "Yes"
    else
    putStrLn "No"