import Control.Applicative 
import Data.Char
import Debug.Trace
import Data.List

splitInt :: String -> [Integer]
splitInt "" = [] :: [Integer]
splitInt str =
    let charToInt :: Integer -> Char -> Integer
        charToInt d c = d * 10 + (fromIntegral $ digitToInt c) :: Integer
        checkInt :: Integer -> String -> (Integer, String)
        checkInt d "" = (d, "")
        checkInt d (' ':rest) = (d, rest)
        checkInt d (c:rest) = checkInt (charToInt d c)  rest
        (num, rest) = checkInt 0 str
        in num : splitInt rest

check :: [[Integer]] -> Bool
check [[aa, ab, ac], [ba, bb, bc], [ca, cb, cc]] = 
    let z = ((aa - ab) == (ba - bb)) && ((aa - ab) == (ca - cb))
        y = ((aa - ac) == (ba - bc)) && ((aa - ac) == (ca - cc))
        x = ((ab - ac) == (bb - bc)) && ((ab - ac) == (cb - cc))
        w = ((aa - ba) == (ab - bb)) && ((aa - ba) == (ac - bc))
        v = ((ba - ca) == (bb - cb)) && ((ba - ca) == (bc - cc))
        u = ((ca - aa) == (cb - ab)) && ((ca - aa) == (cc - ac))
        in z && y && x && w && v && u

getMat :: Int -> IO [[Integer]]
getMat 0 = return [] :: IO [[Integer]]
getMat n = (:) <$> (splitInt <$> getLine) <*> getMat (n - 1)

main = do
    a <- check <$> getMat 3
    putStrLn (if a then "Yes" else "No")
