import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int c11=sc.nextInt();
        int c12=sc.nextInt();
        int c13=sc.nextInt();
        int c21=sc.nextInt();
        int c22=sc.nextInt();
        int c23=sc.nextInt();
        int c31=sc.nextInt();
        int c32=sc.nextInt();
        int c33=sc.nextInt();
        int a=c11-c21;
        int b=c12-c22;
        int d=c13-c23;
        int e=c21-c31;
        int f=c22-c32;
        int g=c23-c33;
        if(a==b&b==d&e==f&f==g) {
            System.out.println("Yes");
        }else {
            System.out.println("No");
        }
            

    }

} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int c11=sc.nextInt();
        int c12=sc.nextInt();
        int c13=sc.nextInt();
        int c21=sc.nextInt();
        int c22=sc.nextInt();
        int c23=sc.nextInt();
        int c31=sc.nextInt();
        int c32=sc.nextInt();
        int c33=sc.nextInt();
        int a=c11-c21;
        int b=c12-c22;
        int d=c13-c23;
        int e=c21-c31;
        int f=c22-c32;
        int g=c23-c33;
        if(a==b&b==d&e==f&f==g) {
            System.out.println("Yes");
        }else {
            System.out.println("No");
        }
            

    }

} Main public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int c11=sc.nextInt();
        int c12=sc.nextInt();
        int c13=sc.nextInt();
        int c21=sc.nextInt();
        int c22=sc.nextInt();
        int c23=sc.nextInt();
        int c31=sc.nextInt();
        int c32=sc.nextInt();
        int c33=sc.nextInt();
        int a=c11-c21;
        int b=c12-c22;
        int d=c13-c23;
        int e=c21-c31;
        int f=c22-c32;
        int g=c23-c33;
        if(a==b&b==d&e==f&f==g) {
            System.out.println("Yes");
        }else {
            System.out.println("No");
        }
            

    } main {
        Scanner sc=new Scanner(System.in);
        int c11=sc.nextInt();
        int c12=sc.nextInt();
        int c13=sc.nextInt();
        int c21=sc.nextInt();
        int c22=sc.nextInt();
        int c23=sc.nextInt();
        int c31=sc.nextInt();
        int c32=sc.nextInt();
        int c33=sc.nextInt();
        int a=c11-c21;
        int b=c12-c22;
        int d=c13-c23;
        int e=c21-c31;
        int f=c22-c32;
        int g=c23-c33;
        if(a==b&b==d&e==f&f==g) {
            System.out.println("Yes");
        }else {
            System.out.println("No");
        }
            

    } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int c11=sc.nextInt(); c11 sc.nextInt() sc.nextInt sc int c12=sc.nextInt(); c12 sc.nextInt() sc.nextInt sc int c13=sc.nextInt(); c13 sc.nextInt() sc.nextInt sc int c21=sc.nextInt(); c21 sc.nextInt() sc.nextInt sc int c22=sc.nextInt(); c22 sc.nextInt() sc.nextInt sc int c23=sc.nextInt(); c23 sc.nextInt() sc.nextInt sc int c31=sc.nextInt(); c31 sc.nextInt() sc.nextInt sc int c32=sc.nextInt(); c32 sc.nextInt() sc.nextInt sc int c33=sc.nextInt(); c33 sc.nextInt() sc.nextInt sc int a=c11-c21; a c11-c21 c11 c21 int b=c12-c22; b c12-c22 c12 c22 int d=c13-c23; d c13-c23 c13 c23 int e=c21-c31; e c21-c31 c21 c31 int f=c22-c32; f c22-c32 c22 c32 int g=c23-c33; g c23-c33 c23 c33 if(a==b&b==d&e==f&f==g) {
            System.out.println("Yes");
        }else {
            System.out.println("No");
        } a==b&b==d&e==f&f==g e==f a==b&b==d&e==f&f==g a==b a b b==d b d e==f e f f==g f g {
            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 {

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int c11=sc.nextInt();
        int c12=sc.nextInt();
        int c13=sc.nextInt();
        int c21=sc.nextInt();
        int c22=sc.nextInt();
        int c23=sc.nextInt();
        int c31=sc.nextInt();
        int c32=sc.nextInt();
        int c33=sc.nextInt();
        int a=c11-c21;
        int b=c12-c22;
        int d=c13-c23;
        int e=c21-c31;
        int f=c22-c32;
        int g=c23-c33;
        if(a==b&b==d&e==f&f==g) {
            System.out.println("Yes");
        }else {
            System.out.println("No");
        }
            

    }

} public class Main {

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int c11=sc.nextInt();
        int c12=sc.nextInt();
        int c13=sc.nextInt();
        int c21=sc.nextInt();
        int c22=sc.nextInt();
        int c23=sc.nextInt();
        int c31=sc.nextInt();
        int c32=sc.nextInt();
        int c33=sc.nextInt();
        int a=c11-c21;
        int b=c12-c22;
        int d=c13-c23;
        int e=c21-c31;
        int f=c22-c32;
        int g=c23-c33;
        if(a==b&b==d&e==f&f==g) {
            System.out.println("Yes");
        }else {
            System.out.println("No");
        }
            

    }

} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int c11=sc.nextInt();
        int c12=sc.nextInt();
        int c13=sc.nextInt();
        int c21=sc.nextInt();
        int c22=sc.nextInt();
        int c23=sc.nextInt();
        int c31=sc.nextInt();
        int c32=sc.nextInt();
        int c33=sc.nextInt();
        int a=c11-c21;
        int b=c12-c22;
        int d=c13-c23;
        int e=c21-c31;
        int f=c22-c32;
        int g=c23-c33;
        if(a==b&b==d&e==f&f==g) {
            System.out.println("Yes");
        }else {
            System.out.println("No");
        }
            

    }

}