import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] a = new int[3][3];
        for(int i=0;i<3;i++)
            for(int j=0;j<3;j++)
                a[i][j] = sc.nextInt();
        int _1 = a[0][1]+a[0][2]+a[1][2];
        int _2 = a[1][0]+a[2][0]+a[2][1];
        int _3 = a[0][0]+a[1][1]+a[2][2];
        if(_1+_2==2*_3) {
            System.out.println("Yes");
        }
        else
            System.out.println("No");
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] a = new int[3][3];
        for(int i=0;i<3;i++)
            for(int j=0;j<3;j++)
                a[i][j] = sc.nextInt();
        int _1 = a[0][1]+a[0][2]+a[1][2];
        int _2 = a[1][0]+a[2][0]+a[2][1];
        int _3 = a[0][0]+a[1][1]+a[2][2];
        if(_1+_2==2*_3) {
            System.out.println("Yes");
        }
        else
            System.out.println("No");
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] a = new int[3][3];
        for(int i=0;i<3;i++)
            for(int j=0;j<3;j++)
                a[i][j] = sc.nextInt();
        int _1 = a[0][1]+a[0][2]+a[1][2];
        int _2 = a[1][0]+a[2][0]+a[2][1];
        int _3 = a[0][0]+a[1][1]+a[2][2];
        if(_1+_2==2*_3) {
            System.out.println("Yes");
        }
        else
            System.out.println("No");
    } main {
        Scanner sc = new Scanner(System.in);
        int[][] a = new int[3][3];
        for(int i=0;i<3;i++)
            for(int j=0;j<3;j++)
                a[i][j] = sc.nextInt();
        int _1 = a[0][1]+a[0][2]+a[1][2];
        int _2 = a[1][0]+a[2][0]+a[2][1];
        int _3 = a[0][0]+a[1][1]+a[2][2];
        if(_1+_2==2*_3) {
            System.out.println("Yes");
        }
        else
            System.out.println("No");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] a = new int[3][3]; a new int[3][3] 3 3 for(int i=0;i<3;i++)
            for(int j=0;j<3;j++)
                a[i][j] = sc.nextInt(); int i=0; int i=0; i 0 i<3 i 3 i++ i++ i for(int j=0;j<3;j++)
                a[i][j] = sc.nextInt(); for(int j=0;j<3;j++)
                a[i][j] = sc.nextInt(); int j=0; int j=0; j 0 j<3 j 3 j++ j++ j a[i][j] = sc.nextInt(); a[i][j] = sc.nextInt() a[i][j] a[i] a i j sc.nextInt() sc.nextInt sc int _1 = a[0][1]+a[0][2]+a[1][2]; _1 a[0][1]+a[0][2]+a[1][2] a[0][1]+a[0][2]+a[1][2] a[0][1] a[0] a 0 1 a[0][2] a[0] a 0 2 a[1][2] a[1] a 1 2 int _2 = a[1][0]+a[2][0]+a[2][1]; _2 a[1][0]+a[2][0]+a[2][1] a[1][0]+a[2][0]+a[2][1] a[1][0] a[1] a 1 0 a[2][0] a[2] a 2 0 a[2][1] a[2] a 2 1 int _3 = a[0][0]+a[1][1]+a[2][2]; _3 a[0][0]+a[1][1]+a[2][2] a[0][0]+a[1][1]+a[2][2] a[0][0] a[0] a 0 0 a[1][1] a[1] a 1 1 a[2][2] a[2] a 2 2 if(_1+_2==2*_3) {
            System.out.println("Yes");
        }
        else
            System.out.println("No"); _1+_2==2*_3 _1+_2 _1 _2 2*_3 2 _3 {
            System.out.println("Yes");
        } System.out.println("Yes") System.out.println System.out System System.out "Yes" System.out.println("No") System.out.println System.out System System.out "No" String[] args args
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] a = new int[3][3];
        for(int i=0;i<3;i++)
            for(int j=0;j<3;j++)
                a[i][j] = sc.nextInt();
        int _1 = a[0][1]+a[0][2]+a[1][2];
        int _2 = a[1][0]+a[2][0]+a[2][1];
        int _3 = a[0][0]+a[1][1]+a[2][2];
        if(_1+_2==2*_3) {
            System.out.println("Yes");
        }
        else
            System.out.println("No");
    }
}