import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int[][] array = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                array[i][j] = sc.nextInt();
            }
        }
        
        int old = 5000;
        int a = array[0][0];
        int b = array[0][1];
        int c = array[0][2];
        for (int i = 0; i < 2; i++) {
            int d = array[i+1][0] - a;
            int e = array[i+1][1] - b;
            int f = array[i+1][2] - c;
            
            if (d == e && e == f) {
                if (i == 1) {
                    System.out.println("Yes");
                    return;
                }
            } else {
                System.out.println("No");
                return;
            }
        }
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int[][] array = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                array[i][j] = sc.nextInt();
            }
        }
        
        int old = 5000;
        int a = array[0][0];
        int b = array[0][1];
        int c = array[0][2];
        for (int i = 0; i < 2; i++) {
            int d = array[i+1][0] - a;
            int e = array[i+1][1] - b;
            int f = array[i+1][2] - c;
            
            if (d == e && e == f) {
                if (i == 1) {
                    System.out.println("Yes");
                    return;
                }
            } else {
                System.out.println("No");
                return;
            }
        }
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int[][] array = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                array[i][j] = sc.nextInt();
            }
        }
        
        int old = 5000;
        int a = array[0][0];
        int b = array[0][1];
        int c = array[0][2];
        for (int i = 0; i < 2; i++) {
            int d = array[i+1][0] - a;
            int e = array[i+1][1] - b;
            int f = array[i+1][2] - c;
            
            if (d == e && e == f) {
                if (i == 1) {
                    System.out.println("Yes");
                    return;
                }
            } else {
                System.out.println("No");
                return;
            }
        }
    } main {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int[][] array = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                array[i][j] = sc.nextInt();
            }
        }
        
        int old = 5000;
        int a = array[0][0];
        int b = array[0][1];
        int c = array[0][2];
        for (int i = 0; i < 2; i++) {
            int d = array[i+1][0] - a;
            int e = array[i+1][1] - b;
            int f = array[i+1][2] - c;
            
            if (d == e && e == f) {
                if (i == 1) {
                    System.out.println("Yes");
                    return;
                }
            } else {
                System.out.println("No");
                return;
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] array = new int[3][3]; array new int[3][3] 3 3 for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                array[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++) {
                array[i][j] = sc.nextInt();
            }
        } {
            for (int j = 0; j < 3; j++) {
                array[i][j] = sc.nextInt();
            }
        } for (int j = 0; j < 3; j++) {
                array[i][j] = sc.nextInt();
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                array[i][j] = sc.nextInt();
            } {
                array[i][j] = sc.nextInt();
            } array[i][j] = sc.nextInt() array[i][j] array[i] array i j sc.nextInt() sc.nextInt sc int old = 5000; old 5000 int a = array[0][0]; a array[0][0] array[0] array 0 0 int b = array[0][1]; b array[0][1] array[0] array 0 1 int c = array[0][2]; c array[0][2] array[0] array 0 2 for (int i = 0; i < 2; i++) {
            int d = array[i+1][0] - a;
            int e = array[i+1][1] - b;
            int f = array[i+1][2] - c;
            
            if (d == e && e == f) {
                if (i == 1) {
                    System.out.println("Yes");
                    return;
                }
            } else {
                System.out.println("No");
                return;
            }
        } int i = 0; int i = 0; i 0 i < 2 i 2 i++ i++ i {
            int d = array[i+1][0] - a;
            int e = array[i+1][1] - b;
            int f = array[i+1][2] - c;
            
            if (d == e && e == f) {
                if (i == 1) {
                    System.out.println("Yes");
                    return;
                }
            } else {
                System.out.println("No");
                return;
            }
        } {
            int d = array[i+1][0] - a;
            int e = array[i+1][1] - b;
            int f = array[i+1][2] - c;
            
            if (d == e && e == f) {
                if (i == 1) {
                    System.out.println("Yes");
                    return;
                }
            } else {
                System.out.println("No");
                return;
            }
        } int d = array[i+1][0] - a; d array[i+1][0] - a array[i+1][0] array[i+1] array i+1 i 1 0 a int e = array[i+1][1] - b; e array[i+1][1] - b array[i+1][1] array[i+1] array i+1 i 1 1 b int f = array[i+1][2] - c; f array[i+1][2] - c array[i+1][2] array[i+1] array i+1 i 1 2 c if (d == e && e == f) {
                if (i == 1) {
                    System.out.println("Yes");
                    return;
                }
            } else {
                System.out.println("No");
                return;
            } d == e && e == f d == e d e e == f e f {
                if (i == 1) {
                    System.out.println("Yes");
                    return;
                }
            } if (i == 1) {
                    System.out.println("Yes");
                    return;
                } i == 1 i 1 {
                    System.out.println("Yes");
                    return;
                } System.out.println("Yes") System.out.println System.out System System.out "Yes" return; {
                System.out.println("No");
                return;
            } System.out.println("No") System.out.println System.out System System.out "No" return; String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int[][] array = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                array[i][j] = sc.nextInt();
            }
        }
        
        int old = 5000;
        int a = array[0][0];
        int b = array[0][1];
        int c = array[0][2];
        for (int i = 0; i < 2; i++) {
            int d = array[i+1][0] - a;
            int e = array[i+1][1] - b;
            int f = array[i+1][2] - c;
            
            if (d == e && e == f) {
                if (i == 1) {
                    System.out.println("Yes");
                    return;
                }
            } else {
                System.out.println("No");
                return;
            }
        }
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int[][] array = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                array[i][j] = sc.nextInt();
            }
        }
        
        int old = 5000;
        int a = array[0][0];
        int b = array[0][1];
        int c = array[0][2];
        for (int i = 0; i < 2; i++) {
            int d = array[i+1][0] - a;
            int e = array[i+1][1] - b;
            int f = array[i+1][2] - c;
            
            if (d == e && e == f) {
                if (i == 1) {
                    System.out.println("Yes");
                    return;
                }
            } else {
                System.out.println("No");
                return;
            }
        }
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int[][] array = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                array[i][j] = sc.nextInt();
            }
        }
        
        int old = 5000;
        int a = array[0][0];
        int b = array[0][1];
        int c = array[0][2];
        for (int i = 0; i < 2; i++) {
            int d = array[i+1][0] - a;
            int e = array[i+1][1] - b;
            int f = array[i+1][2] - c;
            
            if (d == e && e == f) {
                if (i == 1) {
                    System.out.println("Yes");
                    return;
                }
            } else {
                System.out.println("No");
                return;
            }
        }
    }
}
