import java.util.*;
import static java.lang.System.*;
public class Main {
    public static void main(String[] $) {
        Scanner sc = new Scanner(in);
        int[][] c=new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j]=sc.nextInt();
            }
        }
        int[] a=new int[3];
        int[] b=new int[3];
        for (int i = 0; i <= 100; i++) {
            b[0]=i;
            a[0]=c[0][0]-i;
            a[1]=c[1][0]-i;
            a[2]=c[2][0]-i;
            b[1]=c[0][1]-c[0][0]+i;
            b[2]=c[0][2]-c[0][0]+i;
            int d=0;
            for (int j = 1; j <= 2; j++) {
                for (int k = 1; k <= 2; k++) {
                    if(a[j]+b[k]!=c[j][k])d++;
                }
            }
            if(d==0){
                out.println("Yes");
                break;
            }else if(i==100)out.println("No");
        }
    }
} import java.util.*; util.* java import static java.lang.System.*; import static java.lang.System.*; import static java.lang.System.*; public class Main {
    public static void main(String[] $) {
        Scanner sc = new Scanner(in);
        int[][] c=new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j]=sc.nextInt();
            }
        }
        int[] a=new int[3];
        int[] b=new int[3];
        for (int i = 0; i <= 100; i++) {
            b[0]=i;
            a[0]=c[0][0]-i;
            a[1]=c[1][0]-i;
            a[2]=c[2][0]-i;
            b[1]=c[0][1]-c[0][0]+i;
            b[2]=c[0][2]-c[0][0]+i;
            int d=0;
            for (int j = 1; j <= 2; j++) {
                for (int k = 1; k <= 2; k++) {
                    if(a[j]+b[k]!=c[j][k])d++;
                }
            }
            if(d==0){
                out.println("Yes");
                break;
            }else if(i==100)out.println("No");
        }
    }
} Main public static void main(String[] $) {
        Scanner sc = new Scanner(in);
        int[][] c=new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j]=sc.nextInt();
            }
        }
        int[] a=new int[3];
        int[] b=new int[3];
        for (int i = 0; i <= 100; i++) {
            b[0]=i;
            a[0]=c[0][0]-i;
            a[1]=c[1][0]-i;
            a[2]=c[2][0]-i;
            b[1]=c[0][1]-c[0][0]+i;
            b[2]=c[0][2]-c[0][0]+i;
            int d=0;
            for (int j = 1; j <= 2; j++) {
                for (int k = 1; k <= 2; k++) {
                    if(a[j]+b[k]!=c[j][k])d++;
                }
            }
            if(d==0){
                out.println("Yes");
                break;
            }else if(i==100)out.println("No");
        }
    } main {
        Scanner sc = new Scanner(in);
        int[][] c=new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j]=sc.nextInt();
            }
        }
        int[] a=new int[3];
        int[] b=new int[3];
        for (int i = 0; i <= 100; i++) {
            b[0]=i;
            a[0]=c[0][0]-i;
            a[1]=c[1][0]-i;
            a[2]=c[2][0]-i;
            b[1]=c[0][1]-c[0][0]+i;
            b[2]=c[0][2]-c[0][0]+i;
            int d=0;
            for (int j = 1; j <= 2; j++) {
                for (int k = 1; k <= 2; k++) {
                    if(a[j]+b[k]!=c[j][k])d++;
                }
            }
            if(d==0){
                out.println("Yes");
                break;
            }else if(i==100)out.println("No");
        }
    } Scanner sc = new Scanner(in); sc new Scanner(in) int[][] c=new int[3][3]; c new int[3][3] 3 3 for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[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++) {
                c[i][j]=sc.nextInt();
            }
        } {
            for (int j = 0; j < 3; j++) {
                c[i][j]=sc.nextInt();
            }
        } for (int j = 0; j < 3; j++) {
                c[i][j]=sc.nextInt();
            } int j = 0; int j = 0; j 0 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[] a=new int[3]; a new int[3] 3 int[] b=new int[3]; b new int[3] 3 for (int i = 0; i <= 100; i++) {
            b[0]=i;
            a[0]=c[0][0]-i;
            a[1]=c[1][0]-i;
            a[2]=c[2][0]-i;
            b[1]=c[0][1]-c[0][0]+i;
            b[2]=c[0][2]-c[0][0]+i;
            int d=0;
            for (int j = 1; j <= 2; j++) {
                for (int k = 1; k <= 2; k++) {
                    if(a[j]+b[k]!=c[j][k])d++;
                }
            }
            if(d==0){
                out.println("Yes");
                break;
            }else if(i==100)out.println("No");
        } int i = 0; int i = 0; i 0 i <= 100 i 100 i++ i++ i {
            b[0]=i;
            a[0]=c[0][0]-i;
            a[1]=c[1][0]-i;
            a[2]=c[2][0]-i;
            b[1]=c[0][1]-c[0][0]+i;
            b[2]=c[0][2]-c[0][0]+i;
            int d=0;
            for (int j = 1; j <= 2; j++) {
                for (int k = 1; k <= 2; k++) {
                    if(a[j]+b[k]!=c[j][k])d++;
                }
            }
            if(d==0){
                out.println("Yes");
                break;
            }else if(i==100)out.println("No");
        } {
            b[0]=i;
            a[0]=c[0][0]-i;
            a[1]=c[1][0]-i;
            a[2]=c[2][0]-i;
            b[1]=c[0][1]-c[0][0]+i;
            b[2]=c[0][2]-c[0][0]+i;
            int d=0;
            for (int j = 1; j <= 2; j++) {
                for (int k = 1; k <= 2; k++) {
                    if(a[j]+b[k]!=c[j][k])d++;
                }
            }
            if(d==0){
                out.println("Yes");
                break;
            }else if(i==100)out.println("No");
        } b[0]=i b[0] b 0 i a[0]=c[0][0]-i a[0] a 0 c[0][0]-i c[0][0] c[0] c 0 0 i a[1]=c[1][0]-i a[1] a 1 c[1][0]-i c[1][0] c[1] c 1 0 i a[2]=c[2][0]-i a[2] a 2 c[2][0]-i c[2][0] c[2] c 2 0 i b[1]=c[0][1]-c[0][0]+i b[1] b 1 c[0][1]-c[0][0]+i c[0][1]-c[0][0] c[0][1] c[0] c 0 1 c[0][0] c[0] c 0 0 i b[2]=c[0][2]-c[0][0]+i b[2] b 2 c[0][2]-c[0][0]+i c[0][2]-c[0][0] c[0][2] c[0] c 0 2 c[0][0] c[0] c 0 0 i int d=0; d 0 for (int j = 1; j <= 2; j++) {
                for (int k = 1; k <= 2; k++) {
                    if(a[j]+b[k]!=c[j][k])d++;
                }
            } int j = 1; int j = 1; j 1 j <= 2 j 2 j++ j++ j {
                for (int k = 1; k <= 2; k++) {
                    if(a[j]+b[k]!=c[j][k])d++;
                }
            } {
                for (int k = 1; k <= 2; k++) {
                    if(a[j]+b[k]!=c[j][k])d++;
                }
            } for (int k = 1; k <= 2; k++) {
                    if(a[j]+b[k]!=c[j][k])d++;
                } int k = 1; int k = 1; k 1 k <= 2 k 2 k++ k++ k {
                    if(a[j]+b[k]!=c[j][k])d++;
                } {
                    if(a[j]+b[k]!=c[j][k])d++;
                } if(a[j]+b[k]!=c[j][k])d++; a[j]+b[k]!=c[j][k] a[j]+b[k] a[j] a j b[k] b k c[j][k] c[j] c j k d++ d if(d==0){
                out.println("Yes");
                break;
            }else if(i==100)out.println("No"); d==0 d 0 {
                out.println("Yes");
                break;
            } out.println("Yes") out.println out "Yes" break; if(i==100)out.println("No"); i==100 i 100 out.println("No") out.println out "No" String[] $ $ public class Main {
    public static void main(String[] $) {
        Scanner sc = new Scanner(in);
        int[][] c=new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j]=sc.nextInt();
            }
        }
        int[] a=new int[3];
        int[] b=new int[3];
        for (int i = 0; i <= 100; i++) {
            b[0]=i;
            a[0]=c[0][0]-i;
            a[1]=c[1][0]-i;
            a[2]=c[2][0]-i;
            b[1]=c[0][1]-c[0][0]+i;
            b[2]=c[0][2]-c[0][0]+i;
            int d=0;
            for (int j = 1; j <= 2; j++) {
                for (int k = 1; k <= 2; k++) {
                    if(a[j]+b[k]!=c[j][k])d++;
                }
            }
            if(d==0){
                out.println("Yes");
                break;
            }else if(i==100)out.println("No");
        }
    }
} public class Main {
    public static void main(String[] $) {
        Scanner sc = new Scanner(in);
        int[][] c=new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j]=sc.nextInt();
            }
        }
        int[] a=new int[3];
        int[] b=new int[3];
        for (int i = 0; i <= 100; i++) {
            b[0]=i;
            a[0]=c[0][0]-i;
            a[1]=c[1][0]-i;
            a[2]=c[2][0]-i;
            b[1]=c[0][1]-c[0][0]+i;
            b[2]=c[0][2]-c[0][0]+i;
            int d=0;
            for (int j = 1; j <= 2; j++) {
                for (int k = 1; k <= 2; k++) {
                    if(a[j]+b[k]!=c[j][k])d++;
                }
            }
            if(d==0){
                out.println("Yes");
                break;
            }else if(i==100)out.println("No");
        }
    }
} Main
import java.util.*;
import static java.lang.System.*;
public class Main {
    public static void main(String[] $) {
        Scanner sc = new Scanner(in);
        int[][] c=new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j]=sc.nextInt();
            }
        }
        int[] a=new int[3];
        int[] b=new int[3];
        for (int i = 0; i <= 100; i++) {
            b[0]=i;
            a[0]=c[0][0]-i;
            a[1]=c[1][0]-i;
            a[2]=c[2][0]-i;
            b[1]=c[0][1]-c[0][0]+i;
            b[2]=c[0][2]-c[0][0]+i;
            int d=0;
            for (int j = 1; j <= 2; j++) {
                for (int k = 1; k <= 2; k++) {
                    if(a[j]+b[k]!=c[j][k])d++;
                }
            }
            if(d==0){
                out.println("Yes");
                break;
            }else if(i==100)out.println("No");
        }
    }
}