import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);
        int board[][] = new int[3][3];
        for (int y = 0;y < 3;++y){
            for (int x = 0;x < 3;++x){
                board[x][y] = sc.nextInt();
            }
        }
        if(search(board)){
            System.out.println("Yes");
        }
        else System.out.println("No");
    }

    public static boolean search(int board[][]){
        int k = 0;
        for (int j = 1;j <= 2;++j){
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[0][j] - board[0][0];
                }
                else{
                    if(k != board[i][j] - board[i][0]){
                        return false;
                    }
                }
            }
        }
        for (int j = 1;j <= 2;++j){
            for (int i = 0;i < 3;++i){
                if(i == 0){
                    k = board[j][0] - board[0][0];
                }
                else{
                    if(k != board[j][i] - board[0][i]){
                        return false;
                    }
                }
            }
        }
        return true;
    }
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz