using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using static System.Console;
using static PB10004.Algorithm.Util;

namespace PB10004.Algorithm
{
    class Template
    {
        static void Main(string[] args)
        {
            long[,] grid = new long[3,3];
            long a2=-1,a3=-1;
            for(int i =0;i<3;i++){
                var array=ReadLongArray();
                if(a2==-1) a2=array[1]-array[0];
                else if(a2 != array[1]-array[0]){
                    WriteLine("No");
                    return;
                }
                if(a3==-1) a3=array[2]-array[1];
                else if(a3 != array[2] - array[1]) {
                    WriteLine("No");
                    return;
                }
                grid[i,0]=array[0];
                grid[i,1]=array[1];
                grid[i,2]=array[2];
            }
            if(grid[1,0]-grid[0,0]!=grid[1,1]-grid[0,1]||grid[1,1]-grid[0,1]!=grid[1,2]-grid[0,2]) {
                WriteLine("No");
                return;
            }
            if(grid[2,0]-grid[1,0]!=grid[2,1]-grid[1,1]||grid[2,2]-grid[1,2]!=grid[2,1]-grid[1,1]){
                WriteLine("No");
                return;
            }
            WriteLine("Yes");
        }
    }
    public static class Util
    {
        /// <summary>
        /// 標準入力をlong型にパースする
        /// </summary>
        /// <returns></returns>
        public static long ReadLong()
        {
            return long.Parse(ReadLine());
        }
        /// <summary>
        /// 標準入力をlong型の配列にする
        /// </summary>
        /// <returns></returns>
        public static long[] ReadLongArray()
        {
            return ReadLine().Split(' ').Select(long.Parse).ToArray();
        }
        /// <summary>
        /// 一定値の数列を生成する
        /// </summary>
        /// <param name="value"></param>
        /// <param name="length"></param>
        /// <returns></returns>
        public static IEnumerable<long> ConstSeq(long value, long length)
        {
            for (int i = 0; i < length; i++)
            {
                yield return value;
            }
        }
        /// <summary>
        /// int配列の累積和を求める
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static IEnumerable<int> CumulativeSum(IEnumerable<int> array)
        {
            int tmp = 0;
            foreach (var num in array)
                yield return tmp += num;
        }
        /// <summary>
        /// long配列の累積和を求める
        /// </summary>
        /// <param name="array"></param>
        /// <returns></returns>
        public static IEnumerable<long> CumulativeSum(IEnumerable<long> array)
        {
            long tmp = 0;
            foreach (var num in array)
                yield return tmp += num;
        }
        /// <summary>
        /// 最大公約数をユークリッドの互除法で求める
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        public static long Gcd(long a, long b)
        {
            return b == 0 ? a : Gcd(b, a % b);
        }
        /// <summary>
        /// 最小公倍数を求める
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b"></param>
        /// <returns></returns>
        public static long Lcm(long a, long b)
        {
            return a * b / Gcd(a, b);
        }
    }
}

Measured memory_bytes: 13396