//package com.company;

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[][]arr = new int[3][3];
        for(int i = 0; i<3; i++)for(int j = 0; j<3; j++)arr[i][j] = in.nextInt();
        for(int i = 0; i<=100; i++){
            int[]a = new int[3];
            int[]b = new int[3];
            boolean ok = true;
            for(int j = 0; j<3; j++) a[j] = arr[j][0] - i;
            for(int j = 0; j<3; j++) b[j] = arr[0][j] - a[0];
            for(int k = 0; k<3; k++){
                for(int j = 0; j<3; j++){
                    if(arr[k][j] != a[k] + b[j])ok = false;
                }
            }
            if(ok){
                System.out.println("Yes");return;
            }
            a = null;
            b = null;
        }
        System.out.println("No");
    }
} import java.util.*; util.* java public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[][]arr = new int[3][3];
        for(int i = 0; i<3; i++)for(int j = 0; j<3; j++)arr[i][j] = in.nextInt();
        for(int i = 0; i<=100; i++){
            int[]a = new int[3];
            int[]b = new int[3];
            boolean ok = true;
            for(int j = 0; j<3; j++) a[j] = arr[j][0] - i;
            for(int j = 0; j<3; j++) b[j] = arr[0][j] - a[0];
            for(int k = 0; k<3; k++){
                for(int j = 0; j<3; j++){
                    if(arr[k][j] != a[k] + b[j])ok = false;
                }
            }
            if(ok){
                System.out.println("Yes");return;
            }
            a = null;
            b = null;
        }
        System.out.println("No");
    }
} Main public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[][]arr = new int[3][3];
        for(int i = 0; i<3; i++)for(int j = 0; j<3; j++)arr[i][j] = in.nextInt();
        for(int i = 0; i<=100; i++){
            int[]a = new int[3];
            int[]b = new int[3];
            boolean ok = true;
            for(int j = 0; j<3; j++) a[j] = arr[j][0] - i;
            for(int j = 0; j<3; j++) b[j] = arr[0][j] - a[0];
            for(int k = 0; k<3; k++){
                for(int j = 0; j<3; j++){
                    if(arr[k][j] != a[k] + b[j])ok = false;
                }
            }
            if(ok){
                System.out.println("Yes");return;
            }
            a = null;
            b = null;
        }
        System.out.println("No");
    } main {
        Scanner in = new Scanner(System.in);
        int[][]arr = new int[3][3];
        for(int i = 0; i<3; i++)for(int j = 0; j<3; j++)arr[i][j] = in.nextInt();
        for(int i = 0; i<=100; i++){
            int[]a = new int[3];
            int[]b = new int[3];
            boolean ok = true;
            for(int j = 0; j<3; j++) a[j] = arr[j][0] - i;
            for(int j = 0; j<3; j++) b[j] = arr[0][j] - a[0];
            for(int k = 0; k<3; k++){
                for(int j = 0; j<3; j++){
                    if(arr[k][j] != a[k] + b[j])ok = false;
                }
            }
            if(ok){
                System.out.println("Yes");return;
            }
            a = null;
            b = null;
        }
        System.out.println("No");
    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int[][]arr = new int[3][3]; arr new int[3][3] 3 3 for(int i = 0; i<3; i++)for(int j = 0; j<3; j++)arr[i][j] = in.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] = in.nextInt(); for(int j = 0; j<3; j++)arr[i][j] = in.nextInt(); int j = 0; int j = 0; j 0 j<3 j 3 j++ j++ j arr[i][j] = in.nextInt(); arr[i][j] = in.nextInt() arr[i][j] arr[i] arr i j in.nextInt() in.nextInt in for(int i = 0; i<=100; i++){
            int[]a = new int[3];
            int[]b = new int[3];
            boolean ok = true;
            for(int j = 0; j<3; j++) a[j] = arr[j][0] - i;
            for(int j = 0; j<3; j++) b[j] = arr[0][j] - a[0];
            for(int k = 0; k<3; k++){
                for(int j = 0; j<3; j++){
                    if(arr[k][j] != a[k] + b[j])ok = false;
                }
            }
            if(ok){
                System.out.println("Yes");return;
            }
            a = null;
            b = null;
        } int i = 0; int i = 0; i 0 i<=100 i 100 i++ i++ i {
            int[]a = new int[3];
            int[]b = new int[3];
            boolean ok = true;
            for(int j = 0; j<3; j++) a[j] = arr[j][0] - i;
            for(int j = 0; j<3; j++) b[j] = arr[0][j] - a[0];
            for(int k = 0; k<3; k++){
                for(int j = 0; j<3; j++){
                    if(arr[k][j] != a[k] + b[j])ok = false;
                }
            }
            if(ok){
                System.out.println("Yes");return;
            }
            a = null;
            b = null;
        } {
            int[]a = new int[3];
            int[]b = new int[3];
            boolean ok = true;
            for(int j = 0; j<3; j++) a[j] = arr[j][0] - i;
            for(int j = 0; j<3; j++) b[j] = arr[0][j] - a[0];
            for(int k = 0; k<3; k++){
                for(int j = 0; j<3; j++){
                    if(arr[k][j] != a[k] + b[j])ok = false;
                }
            }
            if(ok){
                System.out.println("Yes");return;
            }
            a = null;
            b = null;
        } int[]a = new int[3]; a new int[3] 3 int[]b = new int[3]; b new int[3] 3 boolean ok = true; ok true for(int j = 0; j<3; j++) a[j] = arr[j][0] - i; int j = 0; int j = 0; j 0 j<3 j 3 j++ j++ j a[j] = arr[j][0] - i; a[j] = arr[j][0] - i a[j] a j arr[j][0] - i arr[j][0] arr[j] arr j 0 i for(int j = 0; j<3; j++) b[j] = arr[0][j] - a[0]; int j = 0; int j = 0; j 0 j<3 j 3 j++ j++ j b[j] = arr[0][j] - a[0]; b[j] = arr[0][j] - a[0] b[j] b j arr[0][j] - a[0] arr[0][j] arr[0] arr 0 j a[0] a 0 for(int k = 0; k<3; k++){
                for(int j = 0; j<3; j++){
                    if(arr[k][j] != a[k] + b[j])ok = false;
                }
            } int k = 0; int k = 0; k 0 k<3 k 3 k++ k++ k {
                for(int j = 0; j<3; j++){
                    if(arr[k][j] != a[k] + b[j])ok = false;
                }
            } {
                for(int j = 0; j<3; j++){
                    if(arr[k][j] != a[k] + b[j])ok = false;
                }
            } for(int j = 0; j<3; j++){
                    if(arr[k][j] != a[k] + b[j])ok = false;
                } int j = 0; int j = 0; j 0 j<3 j 3 j++ j++ j {
                    if(arr[k][j] != a[k] + b[j])ok = false;
                } {
                    if(arr[k][j] != a[k] + b[j])ok = false;
                } if(arr[k][j] != a[k] + b[j])ok = false; arr[k][j] != a[k] + b[j] arr[k][j] arr[k] arr k j a[k] + b[j] a[k] a k b[j] b j ok = false ok false if(ok){
                System.out.println("Yes");return;
            } ok {
                System.out.println("Yes");return;
            } System.out.println("Yes") System.out.println System.out System System.out "Yes" return; a = null a null b = null b null 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 in = new Scanner(System.in);
        int[][]arr = new int[3][3];
        for(int i = 0; i<3; i++)for(int j = 0; j<3; j++)arr[i][j] = in.nextInt();
        for(int i = 0; i<=100; i++){
            int[]a = new int[3];
            int[]b = new int[3];
            boolean ok = true;
            for(int j = 0; j<3; j++) a[j] = arr[j][0] - i;
            for(int j = 0; j<3; j++) b[j] = arr[0][j] - a[0];
            for(int k = 0; k<3; k++){
                for(int j = 0; j<3; j++){
                    if(arr[k][j] != a[k] + b[j])ok = false;
                }
            }
            if(ok){
                System.out.println("Yes");return;
            }
            a = null;
            b = null;
        }
        System.out.println("No");
    }
} public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[][]arr = new int[3][3];
        for(int i = 0; i<3; i++)for(int j = 0; j<3; j++)arr[i][j] = in.nextInt();
        for(int i = 0; i<=100; i++){
            int[]a = new int[3];
            int[]b = new int[3];
            boolean ok = true;
            for(int j = 0; j<3; j++) a[j] = arr[j][0] - i;
            for(int j = 0; j<3; j++) b[j] = arr[0][j] - a[0];
            for(int k = 0; k<3; k++){
                for(int j = 0; j<3; j++){
                    if(arr[k][j] != a[k] + b[j])ok = false;
                }
            }
            if(ok){
                System.out.println("Yes");return;
            }
            a = null;
            b = null;
        }
        System.out.println("No");
    }
} Main
//package com.company;

import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int[][]arr = new int[3][3];
        for(int i = 0; i<3; i++)for(int j = 0; j<3; j++)arr[i][j] = in.nextInt();
        for(int i = 0; i<=100; i++){
            int[]a = new int[3];
            int[]b = new int[3];
            boolean ok = true;
            for(int j = 0; j<3; j++) a[j] = arr[j][0] - i;
            for(int j = 0; j<3; j++) b[j] = arr[0][j] - a[0];
            for(int k = 0; k<3; k++){
                for(int j = 0; j<3; j++){
                    if(arr[k][j] != a[k] + b[j])ok = false;
                }
            }
            if(ok){
                System.out.println("Yes");return;
            }
            a = null;
            b = null;
        }
        System.out.println("No");
    }
}
