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


public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic 
        Scanner sc=new Scanner(System.in);
        int c[][]=new int[4][4];
        int a1=1,a2,a3,b1=1,b2,b3;
        for(int i=1;i<=3;i++)
            for(int j=1;j<=3;j++){
                c[i][j]=sc.nextInt();
            }
        int row1=c[1][1]+c[1][2]+c[1][3];
        int row2=c[2][1]+c[2][2]+c[2][3];
        int row3=c[3][1]+c[3][2]+c[3][3];
        int col1=c[1][1]+c[2][1]+c[3][1];
        int col2=c[1][2]+c[2][2]+c[3][2];
        int col3=c[1][3]+c[2][3]+c[3][3];
        if((row2-row1)%3!=0||(row3-row2)%3!=0||(row3-row1)%3!=0||(col2-col1)%3!=0||(col3-col2)%3!=0||(col3-col1)%3!=0){
            System.out.println("No");
        }
        else{
        a2=(row2-row1)/3+a1;
        a3=(row3-row2)/3+a2;
        b2=(col2-col1)/3+b1;
        b3=(col3-col2)/3+b2;
        if(a3-a1==(row3-row1)/3&&b3-b1==(col3-col1)/3){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
        
        }
    }
    
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic 
        Scanner sc=new Scanner(System.in);
        int c[][]=new int[4][4];
        int a1=1,a2,a3,b1=1,b2,b3;
        for(int i=1;i<=3;i++)
            for(int j=1;j<=3;j++){
                c[i][j]=sc.nextInt();
            }
        int row1=c[1][1]+c[1][2]+c[1][3];
        int row2=c[2][1]+c[2][2]+c[2][3];
        int row3=c[3][1]+c[3][2]+c[3][3];
        int col1=c[1][1]+c[2][1]+c[3][1];
        int col2=c[1][2]+c[2][2]+c[3][2];
        int col3=c[1][3]+c[2][3]+c[3][3];
        if((row2-row1)%3!=0||(row3-row2)%3!=0||(row3-row1)%3!=0||(col2-col1)%3!=0||(col3-col2)%3!=0||(col3-col1)%3!=0){
            System.out.println("No");
        }
        else{
        a2=(row2-row1)/3+a1;
        a3=(row3-row2)/3+a2;
        b2=(col2-col1)/3+b1;
        b3=(col3-col2)/3+b2;
        if(a3-a1==(row3-row1)/3&&b3-b1==(col3-col1)/3){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
        
        }
    }
    
} Main /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic 
        Scanner sc=new Scanner(System.in);
        int c[][]=new int[4][4];
        int a1=1,a2,a3,b1=1,b2,b3;
        for(int i=1;i<=3;i++)
            for(int j=1;j<=3;j++){
                c[i][j]=sc.nextInt();
            }
        int row1=c[1][1]+c[1][2]+c[1][3];
        int row2=c[2][1]+c[2][2]+c[2][3];
        int row3=c[3][1]+c[3][2]+c[3][3];
        int col1=c[1][1]+c[2][1]+c[3][1];
        int col2=c[1][2]+c[2][2]+c[3][2];
        int col3=c[1][3]+c[2][3]+c[3][3];
        if((row2-row1)%3!=0||(row3-row2)%3!=0||(row3-row1)%3!=0||(col2-col1)%3!=0||(col3-col2)%3!=0||(col3-col1)%3!=0){
            System.out.println("No");
        }
        else{
        a2=(row2-row1)/3+a1;
        a3=(row3-row2)/3+a2;
        b2=(col2-col1)/3+b1;
        b3=(col3-col2)/3+b2;
        if(a3-a1==(row3-row1)/3&&b3-b1==(col3-col1)/3){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
        
        }
    } main {
        // TODO code application logic 
        Scanner sc=new Scanner(System.in);
        int c[][]=new int[4][4];
        int a1=1,a2,a3,b1=1,b2,b3;
        for(int i=1;i<=3;i++)
            for(int j=1;j<=3;j++){
                c[i][j]=sc.nextInt();
            }
        int row1=c[1][1]+c[1][2]+c[1][3];
        int row2=c[2][1]+c[2][2]+c[2][3];
        int row3=c[3][1]+c[3][2]+c[3][3];
        int col1=c[1][1]+c[2][1]+c[3][1];
        int col2=c[1][2]+c[2][2]+c[3][2];
        int col3=c[1][3]+c[2][3]+c[3][3];
        if((row2-row1)%3!=0||(row3-row2)%3!=0||(row3-row1)%3!=0||(col2-col1)%3!=0||(col3-col2)%3!=0||(col3-col1)%3!=0){
            System.out.println("No");
        }
        else{
        a2=(row2-row1)/3+a1;
        a3=(row3-row2)/3+a2;
        b2=(col2-col1)/3+b1;
        b3=(col3-col2)/3+b2;
        if(a3-a1==(row3-row1)/3&&b3-b1==(col3-col1)/3){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
        
        }
    } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int c[][]=new int[4][4]; c new int[4][4] 4 4 int a1=1 a1 1 a2 a2 a3 a3 b1=1 b1 1 b2 b2 b3; b3 for(int i=1;i<=3;i++)
            for(int j=1;j<=3;j++){
                c[i][j]=sc.nextInt();
            } int i=1; int i=1; i 1 i<=3 i 3 i++ i++ i for(int j=1;j<=3;j++){
                c[i][j]=sc.nextInt();
            } for(int j=1;j<=3;j++){
                c[i][j]=sc.nextInt();
            } int j=1; int j=1; j 1 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 row1=c[1][1]+c[1][2]+c[1][3]; row1 c[1][1]+c[1][2]+c[1][3] c[1][1]+c[1][2]+c[1][3] c[1][1] c[1] c 1 1 c[1][2] c[1] c 1 2 c[1][3] c[1] c 1 3 int row2=c[2][1]+c[2][2]+c[2][3]; row2 c[2][1]+c[2][2]+c[2][3] c[2][1]+c[2][2]+c[2][3] c[2][1] c[2] c 2 1 c[2][2] c[2] c 2 2 c[2][3] c[2] c 2 3 int row3=c[3][1]+c[3][2]+c[3][3]; row3 c[3][1]+c[3][2]+c[3][3] c[3][1]+c[3][2]+c[3][3] c[3][1] c[3] c 3 1 c[3][2] c[3] c 3 2 c[3][3] c[3] c 3 3 int col1=c[1][1]+c[2][1]+c[3][1]; col1 c[1][1]+c[2][1]+c[3][1] c[1][1]+c[2][1]+c[3][1] c[1][1] c[1] c 1 1 c[2][1] c[2] c 2 1 c[3][1] c[3] c 3 1 int col2=c[1][2]+c[2][2]+c[3][2]; col2 c[1][2]+c[2][2]+c[3][2] c[1][2]+c[2][2]+c[3][2] c[1][2] c[1] c 1 2 c[2][2] c[2] c 2 2 c[3][2] c[3] c 3 2 int col3=c[1][3]+c[2][3]+c[3][3]; col3 c[1][3]+c[2][3]+c[3][3] c[1][3]+c[2][3]+c[3][3] c[1][3] c[1] c 1 3 c[2][3] c[2] c 2 3 c[3][3] c[3] c 3 3 if((row2-row1)%3!=0||(row3-row2)%3!=0||(row3-row1)%3!=0||(col2-col1)%3!=0||(col3-col2)%3!=0||(col3-col1)%3!=0){
            System.out.println("No");
        }
        else{
        a2=(row2-row1)/3+a1;
        a3=(row3-row2)/3+a2;
        b2=(col2-col1)/3+b1;
        b3=(col3-col2)/3+b2;
        if(a3-a1==(row3-row1)/3&&b3-b1==(col3-col1)/3){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
        
        } (row2-row1)%3!=0||(row3-row2)%3!=0||(row3-row1)%3!=0||(col2-col1)%3!=0||(col3-col2)%3!=0||(col3-col1)%3!=0 (col3-col2)%3!=0 (col2-col1)%3!=0 (row3-row1)%3!=0 (row2-row1)%3!=0||(row3-row2)%3!=0||(row3-row1)%3!=0||(col2-col1)%3!=0||(col3-col2)%3!=0||(col3-col1)%3!=0 (row2-row1)%3!=0 (row2-row1)%3 (row2-row1) row2 row1 3 0 (row3-row2)%3!=0 (row3-row2)%3 (row3-row2) row3 row2 3 0 (row3-row1)%3!=0 (row3-row1)%3 (row3-row1) row3 row1 3 0 (col2-col1)%3!=0 (col2-col1)%3 (col2-col1) col2 col1 3 0 (col3-col2)%3!=0 (col3-col2)%3 (col3-col2) col3 col2 3 0 (col3-col1)%3!=0 (col3-col1)%3 (col3-col1) col3 col1 3 0 {
            System.out.println("No");
        } System.out.println("No") System.out.println System.out System System.out "No" {
        a2=(row2-row1)/3+a1;
        a3=(row3-row2)/3+a2;
        b2=(col2-col1)/3+b1;
        b3=(col3-col2)/3+b2;
        if(a3-a1==(row3-row1)/3&&b3-b1==(col3-col1)/3){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
        
        } a2=(row2-row1)/3+a1 a2 (row2-row1)/3+a1 (row2-row1)/3 (row2-row1) row2 row1 3 a1 a3=(row3-row2)/3+a2 a3 (row3-row2)/3+a2 (row3-row2)/3 (row3-row2) row3 row2 3 a2 b2=(col2-col1)/3+b1 b2 (col2-col1)/3+b1 (col2-col1)/3 (col2-col1) col2 col1 3 b1 b3=(col3-col2)/3+b2 b3 (col3-col2)/3+b2 (col3-col2)/3 (col3-col2) col3 col2 3 b2 if(a3-a1==(row3-row1)/3&&b3-b1==(col3-col1)/3){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        } a3-a1==(row3-row1)/3&&b3-b1==(col3-col1)/3 a3-a1==(row3-row1)/3 a3-a1 a3 a1 (row3-row1)/3 (row3-row1) row3 row1 3 b3-b1==(col3-col1)/3 b3-b1 b3 b1 (col3-col1)/3 (col3-col1) col3 col1 3 {
            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 public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic 
        Scanner sc=new Scanner(System.in);
        int c[][]=new int[4][4];
        int a1=1,a2,a3,b1=1,b2,b3;
        for(int i=1;i<=3;i++)
            for(int j=1;j<=3;j++){
                c[i][j]=sc.nextInt();
            }
        int row1=c[1][1]+c[1][2]+c[1][3];
        int row2=c[2][1]+c[2][2]+c[2][3];
        int row3=c[3][1]+c[3][2]+c[3][3];
        int col1=c[1][1]+c[2][1]+c[3][1];
        int col2=c[1][2]+c[2][2]+c[3][2];
        int col3=c[1][3]+c[2][3]+c[3][3];
        if((row2-row1)%3!=0||(row3-row2)%3!=0||(row3-row1)%3!=0||(col2-col1)%3!=0||(col3-col2)%3!=0||(col3-col1)%3!=0){
            System.out.println("No");
        }
        else{
        a2=(row2-row1)/3+a1;
        a3=(row3-row2)/3+a2;
        b2=(col2-col1)/3+b1;
        b3=(col3-col2)/3+b2;
        if(a3-a1==(row3-row1)/3&&b3-b1==(col3-col1)/3){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
        
        }
    }
    
} public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic 
        Scanner sc=new Scanner(System.in);
        int c[][]=new int[4][4];
        int a1=1,a2,a3,b1=1,b2,b3;
        for(int i=1;i<=3;i++)
            for(int j=1;j<=3;j++){
                c[i][j]=sc.nextInt();
            }
        int row1=c[1][1]+c[1][2]+c[1][3];
        int row2=c[2][1]+c[2][2]+c[2][3];
        int row3=c[3][1]+c[3][2]+c[3][3];
        int col1=c[1][1]+c[2][1]+c[3][1];
        int col2=c[1][2]+c[2][2]+c[3][2];
        int col3=c[1][3]+c[2][3]+c[3][3];
        if((row2-row1)%3!=0||(row3-row2)%3!=0||(row3-row1)%3!=0||(col2-col1)%3!=0||(col3-col2)%3!=0||(col3-col1)%3!=0){
            System.out.println("No");
        }
        else{
        a2=(row2-row1)/3+a1;
        a3=(row3-row2)/3+a2;
        b2=(col2-col1)/3+b1;
        b3=(col3-col2)/3+b2;
        if(a3-a1==(row3-row1)/3&&b3-b1==(col3-col1)/3){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
        
        }
    }
    
} Main

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


public class Main {

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic 
        Scanner sc=new Scanner(System.in);
        int c[][]=new int[4][4];
        int a1=1,a2,a3,b1=1,b2,b3;
        for(int i=1;i<=3;i++)
            for(int j=1;j<=3;j++){
                c[i][j]=sc.nextInt();
            }
        int row1=c[1][1]+c[1][2]+c[1][3];
        int row2=c[2][1]+c[2][2]+c[2][3];
        int row3=c[3][1]+c[3][2]+c[3][3];
        int col1=c[1][1]+c[2][1]+c[3][1];
        int col2=c[1][2]+c[2][2]+c[3][2];
        int col3=c[1][3]+c[2][3]+c[3][3];
        if((row2-row1)%3!=0||(row3-row2)%3!=0||(row3-row1)%3!=0||(col2-col1)%3!=0||(col3-col2)%3!=0||(col3-col1)%3!=0){
            System.out.println("No");
        }
        else{
        a2=(row2-row1)/3+a1;
        a3=(row3-row2)/3+a2;
        b2=(col2-col1)/3+b1;
        b3=(col3-col2)/3+b2;
        if(a3-a1==(row3-row1)/3&&b3-b1==(col3-col1)/3){
            System.out.println("Yes");
        }
        else{
            System.out.println("No");
        }
        
        }
    }
    
}
