import java.util.ArrayList;
import java.util.Scanner;

/**
 * Created by Santa on 2016/10/16.
 */
public class Main {

    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);

        int[][] map = new int[3][3];
        boolean ans = false;

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                map[i][j] = scanner.nextInt();
            }
        }


        for (int i = 0; i <= 100; i++) {
            for (int j = 0; j <= 100; j++) {
                for (int k = 0; k <= 100; k++) {
                    int ok = 0;
                    int[] b = {map[0][0] - i, map[1][1] - j, map[2][2] - k};

                    if(i + b[1] == map[0][1])ok++;
                    if(i + b[2] == map[0][2])ok++;
                    if(j + b[0] == map[1][0])ok++;
                    if(j + b[2] == map[1][2])ok++;
                    if(k + b[0] == map[2][0])ok++;
                    if(k + b[1] == map[2][1])ok++;

                    if(ok == 6)ans = true;
                }
            }
        }


        if(ans){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }



}

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

    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);

        int[][] map = new int[3][3];
        boolean ans = false;

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                map[i][j] = scanner.nextInt();
            }
        }


        for (int i = 0; i <= 100; i++) {
            for (int j = 0; j <= 100; j++) {
                for (int k = 0; k <= 100; k++) {
                    int ok = 0;
                    int[] b = {map[0][0] - i, map[1][1] - j, map[2][2] - k};

                    if(i + b[1] == map[0][1])ok++;
                    if(i + b[2] == map[0][2])ok++;
                    if(j + b[0] == map[1][0])ok++;
                    if(j + b[2] == map[1][2])ok++;
                    if(k + b[0] == map[2][0])ok++;
                    if(k + b[1] == map[2][1])ok++;

                    if(ok == 6)ans = true;
                }
            }
        }


        if(ans){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }



} Main public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);

        int[][] map = new int[3][3];
        boolean ans = false;

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                map[i][j] = scanner.nextInt();
            }
        }


        for (int i = 0; i <= 100; i++) {
            for (int j = 0; j <= 100; j++) {
                for (int k = 0; k <= 100; k++) {
                    int ok = 0;
                    int[] b = {map[0][0] - i, map[1][1] - j, map[2][2] - k};

                    if(i + b[1] == map[0][1])ok++;
                    if(i + b[2] == map[0][2])ok++;
                    if(j + b[0] == map[1][0])ok++;
                    if(j + b[2] == map[1][2])ok++;
                    if(k + b[0] == map[2][0])ok++;
                    if(k + b[1] == map[2][1])ok++;

                    if(ok == 6)ans = true;
                }
            }
        }


        if(ans){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    } main {
        Scanner scanner = new Scanner(System.in);

        int[][] map = new int[3][3];
        boolean ans = false;

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                map[i][j] = scanner.nextInt();
            }
        }


        for (int i = 0; i <= 100; i++) {
            for (int j = 0; j <= 100; j++) {
                for (int k = 0; k <= 100; k++) {
                    int ok = 0;
                    int[] b = {map[0][0] - i, map[1][1] - j, map[2][2] - k};

                    if(i + b[1] == map[0][1])ok++;
                    if(i + b[2] == map[0][2])ok++;
                    if(j + b[0] == map[1][0])ok++;
                    if(j + b[2] == map[1][2])ok++;
                    if(k + b[0] == map[2][0])ok++;
                    if(k + b[1] == map[2][1])ok++;

                    if(ok == 6)ans = true;
                }
            }
        }


        if(ans){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int[][] map = new int[3][3]; map new int[3][3] 3 3 boolean ans = false; ans false for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                map[i][j] = scanner.nextInt();
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            for (int j = 0; j < 3; j++) {
                map[i][j] = scanner.nextInt();
            }
        } {
            for (int j = 0; j < 3; j++) {
                map[i][j] = scanner.nextInt();
            }
        } for (int j = 0; j < 3; j++) {
                map[i][j] = scanner.nextInt();
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                map[i][j] = scanner.nextInt();
            } {
                map[i][j] = scanner.nextInt();
            } map[i][j] = scanner.nextInt() map[i][j] map[i] map i j scanner.nextInt() scanner.nextInt scanner for (int i = 0; i <= 100; i++) {
            for (int j = 0; j <= 100; j++) {
                for (int k = 0; k <= 100; k++) {
                    int ok = 0;
                    int[] b = {map[0][0] - i, map[1][1] - j, map[2][2] - k};

                    if(i + b[1] == map[0][1])ok++;
                    if(i + b[2] == map[0][2])ok++;
                    if(j + b[0] == map[1][0])ok++;
                    if(j + b[2] == map[1][2])ok++;
                    if(k + b[0] == map[2][0])ok++;
                    if(k + b[1] == map[2][1])ok++;

                    if(ok == 6)ans = true;
                }
            }
        } int i = 0; int i = 0; i 0 i <= 100 i 100 i++ i++ i {
            for (int j = 0; j <= 100; j++) {
                for (int k = 0; k <= 100; k++) {
                    int ok = 0;
                    int[] b = {map[0][0] - i, map[1][1] - j, map[2][2] - k};

                    if(i + b[1] == map[0][1])ok++;
                    if(i + b[2] == map[0][2])ok++;
                    if(j + b[0] == map[1][0])ok++;
                    if(j + b[2] == map[1][2])ok++;
                    if(k + b[0] == map[2][0])ok++;
                    if(k + b[1] == map[2][1])ok++;

                    if(ok == 6)ans = true;
                }
            }
        } {
            for (int j = 0; j <= 100; j++) {
                for (int k = 0; k <= 100; k++) {
                    int ok = 0;
                    int[] b = {map[0][0] - i, map[1][1] - j, map[2][2] - k};

                    if(i + b[1] == map[0][1])ok++;
                    if(i + b[2] == map[0][2])ok++;
                    if(j + b[0] == map[1][0])ok++;
                    if(j + b[2] == map[1][2])ok++;
                    if(k + b[0] == map[2][0])ok++;
                    if(k + b[1] == map[2][1])ok++;

                    if(ok == 6)ans = true;
                }
            }
        } for (int j = 0; j <= 100; j++) {
                for (int k = 0; k <= 100; k++) {
                    int ok = 0;
                    int[] b = {map[0][0] - i, map[1][1] - j, map[2][2] - k};

                    if(i + b[1] == map[0][1])ok++;
                    if(i + b[2] == map[0][2])ok++;
                    if(j + b[0] == map[1][0])ok++;
                    if(j + b[2] == map[1][2])ok++;
                    if(k + b[0] == map[2][0])ok++;
                    if(k + b[1] == map[2][1])ok++;

                    if(ok == 6)ans = true;
                }
            } int j = 0; int j = 0; j 0 j <= 100 j 100 j++ j++ j {
                for (int k = 0; k <= 100; k++) {
                    int ok = 0;
                    int[] b = {map[0][0] - i, map[1][1] - j, map[2][2] - k};

                    if(i + b[1] == map[0][1])ok++;
                    if(i + b[2] == map[0][2])ok++;
                    if(j + b[0] == map[1][0])ok++;
                    if(j + b[2] == map[1][2])ok++;
                    if(k + b[0] == map[2][0])ok++;
                    if(k + b[1] == map[2][1])ok++;

                    if(ok == 6)ans = true;
                }
            } {
                for (int k = 0; k <= 100; k++) {
                    int ok = 0;
                    int[] b = {map[0][0] - i, map[1][1] - j, map[2][2] - k};

                    if(i + b[1] == map[0][1])ok++;
                    if(i + b[2] == map[0][2])ok++;
                    if(j + b[0] == map[1][0])ok++;
                    if(j + b[2] == map[1][2])ok++;
                    if(k + b[0] == map[2][0])ok++;
                    if(k + b[1] == map[2][1])ok++;

                    if(ok == 6)ans = true;
                }
            } for (int k = 0; k <= 100; k++) {
                    int ok = 0;
                    int[] b = {map[0][0] - i, map[1][1] - j, map[2][2] - k};

                    if(i + b[1] == map[0][1])ok++;
                    if(i + b[2] == map[0][2])ok++;
                    if(j + b[0] == map[1][0])ok++;
                    if(j + b[2] == map[1][2])ok++;
                    if(k + b[0] == map[2][0])ok++;
                    if(k + b[1] == map[2][1])ok++;

                    if(ok == 6)ans = true;
                } int k = 0; int k = 0; k 0 k <= 100 k 100 k++ k++ k {
                    int ok = 0;
                    int[] b = {map[0][0] - i, map[1][1] - j, map[2][2] - k};

                    if(i + b[1] == map[0][1])ok++;
                    if(i + b[2] == map[0][2])ok++;
                    if(j + b[0] == map[1][0])ok++;
                    if(j + b[2] == map[1][2])ok++;
                    if(k + b[0] == map[2][0])ok++;
                    if(k + b[1] == map[2][1])ok++;

                    if(ok == 6)ans = true;
                } {
                    int ok = 0;
                    int[] b = {map[0][0] - i, map[1][1] - j, map[2][2] - k};

                    if(i + b[1] == map[0][1])ok++;
                    if(i + b[2] == map[0][2])ok++;
                    if(j + b[0] == map[1][0])ok++;
                    if(j + b[2] == map[1][2])ok++;
                    if(k + b[0] == map[2][0])ok++;
                    if(k + b[1] == map[2][1])ok++;

                    if(ok == 6)ans = true;
                } int ok = 0; ok 0 int[] b = {map[0][0] - i, map[1][1] - j, map[2][2] - k}; b {map[0][0] - i, map[1][1] - j, map[2][2] - k} map[0][0] - i map[0][0] map[0] map 0 0 i map[1][1] - j map[1][1] map[1] map 1 1 j map[2][2] - k map[2][2] map[2] map 2 2 k if(i + b[1] == map[0][1])ok++; i + b[1] == map[0][1] i + b[1] i b[1] b 1 map[0][1] map[0] map 0 1 ok++ ok if(i + b[2] == map[0][2])ok++; i + b[2] == map[0][2] i + b[2] i b[2] b 2 map[0][2] map[0] map 0 2 ok++ ok if(j + b[0] == map[1][0])ok++; j + b[0] == map[1][0] j + b[0] j b[0] b 0 map[1][0] map[1] map 1 0 ok++ ok if(j + b[2] == map[1][2])ok++; j + b[2] == map[1][2] j + b[2] j b[2] b 2 map[1][2] map[1] map 1 2 ok++ ok if(k + b[0] == map[2][0])ok++; k + b[0] == map[2][0] k + b[0] k b[0] b 0 map[2][0] map[2] map 2 0 ok++ ok if(k + b[1] == map[2][1])ok++; k + b[1] == map[2][1] k + b[1] k b[1] b 1 map[2][1] map[2] map 2 1 ok++ ok if(ok == 6)ans = true; ok == 6 ok 6 ans = true ans true if(ans){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        } ans {
            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 scanner = new Scanner(System.in);

        int[][] map = new int[3][3];
        boolean ans = false;

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                map[i][j] = scanner.nextInt();
            }
        }


        for (int i = 0; i <= 100; i++) {
            for (int j = 0; j <= 100; j++) {
                for (int k = 0; k <= 100; k++) {
                    int ok = 0;
                    int[] b = {map[0][0] - i, map[1][1] - j, map[2][2] - k};

                    if(i + b[1] == map[0][1])ok++;
                    if(i + b[2] == map[0][2])ok++;
                    if(j + b[0] == map[1][0])ok++;
                    if(j + b[2] == map[1][2])ok++;
                    if(k + b[0] == map[2][0])ok++;
                    if(k + b[1] == map[2][1])ok++;

                    if(ok == 6)ans = true;
                }
            }
        }


        if(ans){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }



} public class Main {

    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);

        int[][] map = new int[3][3];
        boolean ans = false;

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                map[i][j] = scanner.nextInt();
            }
        }


        for (int i = 0; i <= 100; i++) {
            for (int j = 0; j <= 100; j++) {
                for (int k = 0; k <= 100; k++) {
                    int ok = 0;
                    int[] b = {map[0][0] - i, map[1][1] - j, map[2][2] - k};

                    if(i + b[1] == map[0][1])ok++;
                    if(i + b[2] == map[0][2])ok++;
                    if(j + b[0] == map[1][0])ok++;
                    if(j + b[2] == map[1][2])ok++;
                    if(k + b[0] == map[2][0])ok++;
                    if(k + b[1] == map[2][1])ok++;

                    if(ok == 6)ans = true;
                }
            }
        }


        if(ans){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }



} Main
import java.util.ArrayList;
import java.util.Scanner;

/**
 * Created by Santa on 2016/10/16.
 */
public class Main {

    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);

        int[][] map = new int[3][3];
        boolean ans = false;

        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                map[i][j] = scanner.nextInt();
            }
        }


        for (int i = 0; i <= 100; i++) {
            for (int j = 0; j <= 100; j++) {
                for (int k = 0; k <= 100; k++) {
                    int ok = 0;
                    int[] b = {map[0][0] - i, map[1][1] - j, map[2][2] - k};

                    if(i + b[1] == map[0][1])ok++;
                    if(i + b[2] == map[0][2])ok++;
                    if(j + b[0] == map[1][0])ok++;
                    if(j + b[2] == map[1][2])ok++;
                    if(k + b[0] == map[2][0])ok++;
                    if(k + b[1] == map[2][1])ok++;

                    if(ok == 6)ans = true;
                }
            }
        }


        if(ans){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }



}


