import java.util.*;
import java.lang.*;
import java.io.*;

public class Main {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        
        int[][] arr = new int[3][];
        for(int i = 0; i < 3; i++) arr[i] = new int[3];
        
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++) arr[i][j] = scan.nextInt();
        }
        
        int[] diff = new int[9];
        
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++) diff[i*3+j] = arr[i][j] - arr[i][(j+1)%3];
        }
        
        for(int i = 0; i < 3; i++){
            if(diff[i] != diff[i+3] || diff[i+3] != diff[i+6]){
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    }
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java public class Main {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        
        int[][] arr = new int[3][];
        for(int i = 0; i < 3; i++) arr[i] = new int[3];
        
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++) arr[i][j] = scan.nextInt();
        }
        
        int[] diff = new int[9];
        
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++) diff[i*3+j] = arr[i][j] - arr[i][(j+1)%3];
        }
        
        for(int i = 0; i < 3; i++){
            if(diff[i] != diff[i+3] || diff[i+3] != diff[i+6]){
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    }
} Main public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        
        int[][] arr = new int[3][];
        for(int i = 0; i < 3; i++) arr[i] = new int[3];
        
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++) arr[i][j] = scan.nextInt();
        }
        
        int[] diff = new int[9];
        
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++) diff[i*3+j] = arr[i][j] - arr[i][(j+1)%3];
        }
        
        for(int i = 0; i < 3; i++){
            if(diff[i] != diff[i+3] || diff[i+3] != diff[i+6]){
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    } main {
        Scanner scan = new Scanner(System.in);
        
        int[][] arr = new int[3][];
        for(int i = 0; i < 3; i++) arr[i] = new int[3];
        
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++) arr[i][j] = scan.nextInt();
        }
        
        int[] diff = new int[9];
        
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++) diff[i*3+j] = arr[i][j] - arr[i][(j+1)%3];
        }
        
        for(int i = 0; i < 3; i++){
            if(diff[i] != diff[i+3] || diff[i+3] != diff[i+6]){
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int[][] arr = new int[3][]; arr new int[3][] 3 for(int i = 0; i < 3; i++) arr[i] = new int[3]; int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i arr[i] = new int[3]; arr[i] = new int[3] arr[i] arr i new int[3] 3 for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++) arr[i][j] = scan.nextInt();
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            for(int j = 0; j < 3; j++) arr[i][j] = scan.nextInt();
        } {
            for(int j = 0; j < 3; j++) arr[i][j] = scan.nextInt();
        } for(int j = 0; j < 3; j++) arr[i][j] = scan.nextInt(); int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j arr[i][j] = scan.nextInt(); arr[i][j] = scan.nextInt() arr[i][j] arr[i] arr i j scan.nextInt() scan.nextInt scan int[] diff = new int[9]; diff new int[9] 9 for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++) diff[i*3+j] = arr[i][j] - arr[i][(j+1)%3];
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            for(int j = 0; j < 3; j++) diff[i*3+j] = arr[i][j] - arr[i][(j+1)%3];
        } {
            for(int j = 0; j < 3; j++) diff[i*3+j] = arr[i][j] - arr[i][(j+1)%3];
        } for(int j = 0; j < 3; j++) diff[i*3+j] = arr[i][j] - arr[i][(j+1)%3]; int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j diff[i*3+j] = arr[i][j] - arr[i][(j+1)%3]; diff[i*3+j] = arr[i][j] - arr[i][(j+1)%3] diff[i*3+j] diff i*3+j i*3 i 3 j arr[i][j] - arr[i][(j+1)%3] arr[i][j] arr[i] arr i j arr[i][(j+1)%3] arr[i] arr i (j+1)%3 (j+1) j 1 3 for(int i = 0; i < 3; i++){
            if(diff[i] != diff[i+3] || diff[i+3] != diff[i+6]){
                System.out.println("No");
                return;
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            if(diff[i] != diff[i+3] || diff[i+3] != diff[i+6]){
                System.out.println("No");
                return;
            }
        } {
            if(diff[i] != diff[i+3] || diff[i+3] != diff[i+6]){
                System.out.println("No");
                return;
            }
        } if(diff[i] != diff[i+3] || diff[i+3] != diff[i+6]){
                System.out.println("No");
                return;
            } diff[i] != diff[i+3] || diff[i+3] != diff[i+6] diff[i] != diff[i+3] diff[i] diff i diff[i+3] diff i+3 i 3 diff[i+3] != diff[i+6] diff[i+3] diff i+3 i 3 diff[i+6] diff i+6 i 6 {
                System.out.println("No");
                return;
            } System.out.println("No") System.out.println System.out System System.out "No" return; System.out.println("Yes") System.out.println System.out System System.out "Yes" String args[] args public class Main {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        
        int[][] arr = new int[3][];
        for(int i = 0; i < 3; i++) arr[i] = new int[3];
        
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++) arr[i][j] = scan.nextInt();
        }
        
        int[] diff = new int[9];
        
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++) diff[i*3+j] = arr[i][j] - arr[i][(j+1)%3];
        }
        
        for(int i = 0; i < 3; i++){
            if(diff[i] != diff[i+3] || diff[i+3] != diff[i+6]){
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    }
} public class Main {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        
        int[][] arr = new int[3][];
        for(int i = 0; i < 3; i++) arr[i] = new int[3];
        
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++) arr[i][j] = scan.nextInt();
        }
        
        int[] diff = new int[9];
        
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++) diff[i*3+j] = arr[i][j] - arr[i][(j+1)%3];
        }
        
        for(int i = 0; i < 3; i++){
            if(diff[i] != diff[i+3] || diff[i+3] != diff[i+6]){
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    }
} Main
import java.util.*;
import java.lang.*;
import java.io.*;

public class Main {
    public static void main(String args[]) {
        Scanner scan = new Scanner(System.in);
        
        int[][] arr = new int[3][];
        for(int i = 0; i < 3; i++) arr[i] = new int[3];
        
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++) arr[i][j] = scan.nextInt();
        }
        
        int[] diff = new int[9];
        
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++) diff[i*3+j] = arr[i][j] - arr[i][(j+1)%3];
        }
        
        for(int i = 0; i < 3; i++){
            if(diff[i] != diff[i+3] || diff[i+3] != diff[i+6]){
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    }
}
