import Data.List

main = do
  c <- getContents >>= return . map (map read . words) . lines :: IO [[Int]]

  putStrLn $ if all (\x -> and (func (==) $ map (func (\a b -> b - a)) x)) [c, transpose c]
    then "Yes"
    else "No"

  where
    func f (a:b:[]) = [f a b]
    func f (a:b:xs) = (f a b) : func f (b:xs)
