import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[][] c = new int[3][3];
        String result = "Yes";

        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                c[i][j] = in.nextInt();
            }
        }
        int b1 = c[0][0];
        int b2 = c[1][0];
        int b3 = c[2][0];
        if ((c[0][1] - b1 != c[1][1] -b2) || (c[1][1] -b2 != c[2][1] -b3)){
            result = "No";
        }
        if ((c[0][2] - b1 != c[1][2] -b2) || (c[1][2] -b2 != c[2][2] -b3)){
            result = "No";
        }

        System.out.println(result);
        
        in.close();
    }
} import java.io.*; io.* java import java.util.*; util.* java import java.text.*; text.* java import java.math.*; math.* java import java.util.regex.*; regex.* java.util public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[][] c = new int[3][3];
        String result = "Yes";

        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                c[i][j] = in.nextInt();
            }
        }
        int b1 = c[0][0];
        int b2 = c[1][0];
        int b3 = c[2][0];
        if ((c[0][1] - b1 != c[1][1] -b2) || (c[1][1] -b2 != c[2][1] -b3)){
            result = "No";
        }
        if ((c[0][2] - b1 != c[1][2] -b2) || (c[1][2] -b2 != c[2][2] -b3)){
            result = "No";
        }

        System.out.println(result);
        
        in.close();
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[][] c = new int[3][3];
        String result = "Yes";

        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                c[i][j] = in.nextInt();
            }
        }
        int b1 = c[0][0];
        int b2 = c[1][0];
        int b3 = c[2][0];
        if ((c[0][1] - b1 != c[1][1] -b2) || (c[1][1] -b2 != c[2][1] -b3)){
            result = "No";
        }
        if ((c[0][2] - b1 != c[1][2] -b2) || (c[1][2] -b2 != c[2][2] -b3)){
            result = "No";
        }

        System.out.println(result);
        
        in.close();
    } main {
        Scanner in = new Scanner(System.in);
        int[][] c = new int[3][3];
        String result = "Yes";

        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                c[i][j] = in.nextInt();
            }
        }
        int b1 = c[0][0];
        int b2 = c[1][0];
        int b3 = c[2][0];
        if ((c[0][1] - b1 != c[1][1] -b2) || (c[1][1] -b2 != c[2][1] -b3)){
            result = "No";
        }
        if ((c[0][2] - b1 != c[1][2] -b2) || (c[1][2] -b2 != c[2][2] -b3)){
            result = "No";
        }

        System.out.println(result);
        
        in.close();
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int[][] c = new int[3][3]; c new int[3][3] 3 3 String result = "Yes"; result "Yes" for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                c[i][j] = in.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] = in.nextInt();
            }
        } {
            for(int j = 0; j < 3; j++){
                c[i][j] = in.nextInt();
            }
        } for(int j = 0; j < 3; j++){
                c[i][j] = in.nextInt();
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                c[i][j] = in.nextInt();
            } {
                c[i][j] = in.nextInt();
            } c[i][j] = in.nextInt() c[i][j] c[i] c i j in.nextInt() in.nextInt in int b1 = c[0][0]; b1 c[0][0] c[0] c 0 0 int b2 = c[1][0]; b2 c[1][0] c[1] c 1 0 int b3 = c[2][0]; b3 c[2][0] c[2] c 2 0 if ((c[0][1] - b1 != c[1][1] -b2) || (c[1][1] -b2 != c[2][1] -b3)){
            result = "No";
        } (c[0][1] - b1 != c[1][1] -b2) || (c[1][1] -b2 != c[2][1] -b3) (c[0][1] - b1 != c[1][1] -b2) c[0][1] - b1 c[0][1] c[0] c 0 1 b1 c[1][1] -b2 c[1][1] c[1] c 1 1 b2 (c[1][1] -b2 != c[2][1] -b3) c[1][1] -b2 c[1][1] c[1] c 1 1 b2 c[2][1] -b3 c[2][1] c[2] c 2 1 b3 {
            result = "No";
        } result = "No" result "No" if ((c[0][2] - b1 != c[1][2] -b2) || (c[1][2] -b2 != c[2][2] -b3)){
            result = "No";
        } (c[0][2] - b1 != c[1][2] -b2) || (c[1][2] -b2 != c[2][2] -b3) (c[0][2] - b1 != c[1][2] -b2) c[0][2] - b1 c[0][2] c[0] c 0 2 b1 c[1][2] -b2 c[1][2] c[1] c 1 2 b2 (c[1][2] -b2 != c[2][2] -b3) c[1][2] -b2 c[1][2] c[1] c 1 2 b2 c[2][2] -b3 c[2][2] c[2] c 2 2 b3 {
            result = "No";
        } result = "No" result "No" System.out.println(result) System.out.println System.out System System.out result in.close() in.close in String[] args args public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[][] c = new int[3][3];
        String result = "Yes";

        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                c[i][j] = in.nextInt();
            }
        }
        int b1 = c[0][0];
        int b2 = c[1][0];
        int b3 = c[2][0];
        if ((c[0][1] - b1 != c[1][1] -b2) || (c[1][1] -b2 != c[2][1] -b3)){
            result = "No";
        }
        if ((c[0][2] - b1 != c[1][2] -b2) || (c[1][2] -b2 != c[2][2] -b3)){
            result = "No";
        }

        System.out.println(result);
        
        in.close();
    }
} public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[][] c = new int[3][3];
        String result = "Yes";

        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                c[i][j] = in.nextInt();
            }
        }
        int b1 = c[0][0];
        int b2 = c[1][0];
        int b3 = c[2][0];
        if ((c[0][1] - b1 != c[1][1] -b2) || (c[1][1] -b2 != c[2][1] -b3)){
            result = "No";
        }
        if ((c[0][2] - b1 != c[1][2] -b2) || (c[1][2] -b2 != c[2][2] -b3)){
            result = "No";
        }

        System.out.println(result);
        
        in.close();
    }
} Main
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[][] c = new int[3][3];
        String result = "Yes";

        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                c[i][j] = in.nextInt();
            }
        }
        int b1 = c[0][0];
        int b2 = c[1][0];
        int b3 = c[2][0];
        if ((c[0][1] - b1 != c[1][1] -b2) || (c[1][1] -b2 != c[2][1] -b3)){
            result = "No";
        }
        if ((c[0][2] - b1 != c[1][2] -b2) || (c[1][2] -b2 != c[2][2] -b3)){
            result = "No";
        }

        System.out.println(result);
        
        in.close();
    }
}
