valid :: [Int] -> [Int] -> [Int] -> String
valid r1 r2 r3 = if same (delta r1 r2) && same (delta r2 r3) then "Yes" else "No" 

delta :: [Int] -> [Int] -> [Int]
delta [] [] = []
delta (x:xs) (y:ys) = (x-y):(delta xs ys)

same :: [Int] -> Bool
same []  = True
same [x] = True
same (x:y:xs)
    | x == y = same (y:xs)
    | otherwise = False

readData :: IO [Int]
readData = do
    line1 <- getLine
    let xs = map (\x -> read x :: Int) (words line1)
    return xs

main :: IO() 
main = do
    r1 <- readData
    r2 <- readData
    r3 <- readData
    let ans = valid r1 r2 r3
    putStrLn ans