import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int[][] c = new int[3][3];

        for(int i=0; i<3; i++){
            for(int j=0; j<3; j++){
                c[i][j] = sc.nextInt();
            }
        }
        int[][] d = new int[3][2];

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

        int[][] c = new int[3][3];

        for(int i=0; i<3; i++){
            for(int j=0; j<3; j++){
                c[i][j] = sc.nextInt();
            }
        }
        int[][] d = new int[3][2];

        for(int i=0; i<3; i++){
            for(int j=0; j<2; j++){
                d[i][j] = c[i][j + 1] - c[i][j];
            }
        }
        if(d[0][0]==d[1][0] && d[1][0]==d[2][0] && d[0][1]==d[1][1] && d[1][1]==d[2][1]){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int[][] c = new int[3][3];

        for(int i=0; i<3; i++){
            for(int j=0; j<3; j++){
                c[i][j] = sc.nextInt();
            }
        }
        int[][] d = new int[3][2];

        for(int i=0; i<3; i++){
            for(int j=0; j<2; j++){
                d[i][j] = c[i][j + 1] - c[i][j];
            }
        }
        if(d[0][0]==d[1][0] && d[1][0]==d[2][0] && d[0][1]==d[1][1] && d[1][1]==d[2][1]){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
    } main {
        Scanner sc = new Scanner(System.in);

        int[][] c = new int[3][3];

        for(int i=0; i<3; i++){
            for(int j=0; j<3; j++){
                c[i][j] = sc.nextInt();
            }
        }
        int[][] d = new int[3][2];

        for(int i=0; i<3; i++){
            for(int j=0; j<2; j++){
                d[i][j] = c[i][j + 1] - c[i][j];
            }
        }
        if(d[0][0]==d[1][0] && d[1][0]==d[2][0] && d[0][1]==d[1][1] && d[1][1]==d[2][1]){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] c = new int[3][3]; c new int[3][3] 3 3 for(int i=0; i<3; i++){
            for(int j=0; j<3; j++){
                c[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++){
                c[i][j] = sc.nextInt();
            }
        } {
            for(int j=0; j<3; j++){
                c[i][j] = sc.nextInt();
            }
        } for(int j=0; j<3; j++){
                c[i][j] = sc.nextInt();
            } int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
                c[i][j] = sc.nextInt();
            } {
                c[i][j] = sc.nextInt();
            } c[i][j] = sc.nextInt() c[i][j] c[i] c i j sc.nextInt() sc.nextInt sc int[][] d = new int[3][2]; d new int[3][2] 3 2 for(int i=0; i<3; i++){
            for(int j=0; j<2; j++){
                d[i][j] = c[i][j + 1] - c[i][j];
            }
        } int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
            for(int j=0; j<2; j++){
                d[i][j] = c[i][j + 1] - c[i][j];
            }
        } {
            for(int j=0; j<2; j++){
                d[i][j] = c[i][j + 1] - c[i][j];
            }
        } for(int j=0; j<2; j++){
                d[i][j] = c[i][j + 1] - c[i][j];
            } int j=0; int j=0; j 0 j<2 j 2 j++ j++ j {
                d[i][j] = c[i][j + 1] - c[i][j];
            } {
                d[i][j] = c[i][j + 1] - c[i][j];
            } d[i][j] = c[i][j + 1] - c[i][j] d[i][j] d[i] d i j c[i][j + 1] - c[i][j] c[i][j + 1] c[i] c i j + 1 j 1 c[i][j] c[i] c i j if(d[0][0]==d[1][0] && d[1][0]==d[2][0] && d[0][1]==d[1][1] && d[1][1]==d[2][1]){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        } d[0][0]==d[1][0] && d[1][0]==d[2][0] && d[0][1]==d[1][1] && d[1][1]==d[2][1] d[0][1]==d[1][1] d[0][0]==d[1][0] && d[1][0]==d[2][0] && d[0][1]==d[1][1] && d[1][1]==d[2][1] d[0][0]==d[1][0] d[0][0] d[0] d 0 0 d[1][0] d[1] d 1 0 d[1][0]==d[2][0] d[1][0] d[1] d 1 0 d[2][0] d[2] d 2 0 d[0][1]==d[1][1] d[0][1] d[0] d 0 1 d[1][1] d[1] d 1 1 d[1][1]==d[2][1] d[1][1] d[1] d 1 1 d[2][1] d[2] d 2 1 {
            System.out.println("Yes");
        } System.out.println("Yes") System.out.println System.out System System.out "Yes" {
            System.out.println("No");
        } System.out.println("No") System.out.println System.out System System.out "No" String[] args args
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        int[][] c = new int[3][3];

        for(int i=0; i<3; i++){
            for(int j=0; j<3; j++){
                c[i][j] = sc.nextInt();
            }
        }
        int[][] d = new int[3][2];

        for(int i=0; i<3; i++){
            for(int j=0; j<2; j++){
                d[i][j] = c[i][j + 1] - c[i][j];
            }
        }
        if(d[0][0]==d[1][0] && d[1][0]==d[2][0] && d[0][1]==d[1][1] && d[1][1]==d[2][1]){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
    }
}