{-# OPTIONS_GHC -O #-}

import Control.Monad
import Data.List
import Data.Foldable

main=do
    a1@[a11,a12,a13] <- map read.words<$>getLine :: IO[Int]
    a2@[a21,a22,a23] <- map read.words<$>getLine :: IO[Int]
    a3@[a31,a32,a33] <- map read.words<$>getLine :: IO[Int]

    putStrLn $ if (and [chk a1 a2, chk a2 a3, chk a1 a3,
     chk [a11,a21,a31] [a12,a22,a32],
     chk [a12,a22,a32] [a13,a23,a33],
     chk [a11,a21,a31] [a13,a23,a33]])
        then "Yes"
        else "No"

chk :: [Int]->[Int]->Bool
chk as bs =
    (\[a,b,c] -> a==b && b==c) $ zipWith (-) as bs