import Control.Monad
import Control.Applicative
import Data.List
import qualified Data.Map as Map
import Data.Array
import qualified Data.ByteString.Char8 as BC
import Data.Maybe
bsreadInt :: BC.ByteString -> Int
bsreadInt = fst . fromJust . BC.readInt
strToInt s = (read :: String -> Int) s

main = do

   [c11,c12,c13] <- map bsreadInt . BC.words <$> BC.getLine
   [c21,c22,c23] <- map bsreadInt . BC.words <$> BC.getLine
   [c31,c32,c33] <- map bsreadInt . BC.words <$> BC.getLine
   let cn = [c11,c12,c13,c21,c22,c23,c31,c32,c33]
   if (crit1 cn) && (crit2 cn) == True then putStrLn "Yes"
                                       else putStrLn "No"

crit1 :: [Int] -> Bool
crit1 [c11,c12,c13,c21,c22,c23,c31,c32,c33] = if ((c21-c11) == (c22-c12)) && ((c23-c13) == (c22-c12))
                                              then True
                                              else False

crit2 :: [Int] -> Bool
crit2 [c11,c12,c13,c21,c22,c23,c31,c32,c33] = if ((c31-c11) == (c32-c12)) && ((c32-c12) == (c33-c13))
                                              then True
                                              else False