import java.util.Scanner;

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

        int[][] c = new int[3][3];
        int[] a = new int[3];
        int[] b = new int[3];

        for (int y = 0; y < 3; y++) {
            for (int x = 0; x < 3; x++) {
                c[y][x] = sc.nextInt();
                if (y == 0)
                    b[x] = c[y][x];
                else
                    a[y] = c[y][x] - b[x];
            }
        }

        boolean isAns = true;
        for (int y = 0; y < 3; y++) {
            for (int x = 0; x < 3; x++) {
                if (c[y][x] != a[y] + b[x]) {
                    isAns = false;
                    break;
                }
            }
        }

        System.out.println(isAns ? "Yes" : "No");
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int[][] c = new int[3][3];
        int[] a = new int[3];
        int[] b = new int[3];

        for (int y = 0; y < 3; y++) {
            for (int x = 0; x < 3; x++) {
                c[y][x] = sc.nextInt();
                if (y == 0)
                    b[x] = c[y][x];
                else
                    a[y] = c[y][x] - b[x];
            }
        }

        boolean isAns = true;
        for (int y = 0; y < 3; y++) {
            for (int x = 0; x < 3; x++) {
                if (c[y][x] != a[y] + b[x]) {
                    isAns = false;
                    break;
                }
            }
        }

        System.out.println(isAns ? "Yes" : "No");
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int[][] c = new int[3][3];
        int[] a = new int[3];
        int[] b = new int[3];

        for (int y = 0; y < 3; y++) {
            for (int x = 0; x < 3; x++) {
                c[y][x] = sc.nextInt();
                if (y == 0)
                    b[x] = c[y][x];
                else
                    a[y] = c[y][x] - b[x];
            }
        }

        boolean isAns = true;
        for (int y = 0; y < 3; y++) {
            for (int x = 0; x < 3; x++) {
                if (c[y][x] != a[y] + b[x]) {
                    isAns = false;
                    break;
                }
            }
        }

        System.out.println(isAns ? "Yes" : "No");
    } main {
        Scanner sc = new Scanner(System.in);

        int[][] c = new int[3][3];
        int[] a = new int[3];
        int[] b = new int[3];

        for (int y = 0; y < 3; y++) {
            for (int x = 0; x < 3; x++) {
                c[y][x] = sc.nextInt();
                if (y == 0)
                    b[x] = c[y][x];
                else
                    a[y] = c[y][x] - b[x];
            }
        }

        boolean isAns = true;
        for (int y = 0; y < 3; y++) {
            for (int x = 0; x < 3; x++) {
                if (c[y][x] != a[y] + b[x]) {
                    isAns = false;
                    break;
                }
            }
        }

        System.out.println(isAns ? "Yes" : "No");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] c = new int[3][3]; c new int[3][3] 3 3 int[] a = new int[3]; a new int[3] 3 int[] b = new int[3]; b new int[3] 3 for (int y = 0; y < 3; y++) {
            for (int x = 0; x < 3; x++) {
                c[y][x] = sc.nextInt();
                if (y == 0)
                    b[x] = c[y][x];
                else
                    a[y] = c[y][x] - b[x];
            }
        } int y = 0; int y = 0; y 0 y < 3 y 3 y++ y++ y {
            for (int x = 0; x < 3; x++) {
                c[y][x] = sc.nextInt();
                if (y == 0)
                    b[x] = c[y][x];
                else
                    a[y] = c[y][x] - b[x];
            }
        } {
            for (int x = 0; x < 3; x++) {
                c[y][x] = sc.nextInt();
                if (y == 0)
                    b[x] = c[y][x];
                else
                    a[y] = c[y][x] - b[x];
            }
        } for (int x = 0; x < 3; x++) {
                c[y][x] = sc.nextInt();
                if (y == 0)
                    b[x] = c[y][x];
                else
                    a[y] = c[y][x] - b[x];
            } int x = 0; int x = 0; x 0 x < 3 x 3 x++ x++ x {
                c[y][x] = sc.nextInt();
                if (y == 0)
                    b[x] = c[y][x];
                else
                    a[y] = c[y][x] - b[x];
            } {
                c[y][x] = sc.nextInt();
                if (y == 0)
                    b[x] = c[y][x];
                else
                    a[y] = c[y][x] - b[x];
            } c[y][x] = sc.nextInt() c[y][x] c[y] c y x sc.nextInt() sc.nextInt sc if (y == 0)
                    b[x] = c[y][x];
                else
                    a[y] = c[y][x] - b[x]; y == 0 y 0 b[x] = c[y][x] b[x] b x c[y][x] c[y] c y x a[y] = c[y][x] - b[x] a[y] a y c[y][x] - b[x] c[y][x] c[y] c y x b[x] b x boolean isAns = true; isAns true for (int y = 0; y < 3; y++) {
            for (int x = 0; x < 3; x++) {
                if (c[y][x] != a[y] + b[x]) {
                    isAns = false;
                    break;
                }
            }
        } int y = 0; int y = 0; y 0 y < 3 y 3 y++ y++ y {
            for (int x = 0; x < 3; x++) {
                if (c[y][x] != a[y] + b[x]) {
                    isAns = false;
                    break;
                }
            }
        } {
            for (int x = 0; x < 3; x++) {
                if (c[y][x] != a[y] + b[x]) {
                    isAns = false;
                    break;
                }
            }
        } for (int x = 0; x < 3; x++) {
                if (c[y][x] != a[y] + b[x]) {
                    isAns = false;
                    break;
                }
            } int x = 0; int x = 0; x 0 x < 3 x 3 x++ x++ x {
                if (c[y][x] != a[y] + b[x]) {
                    isAns = false;
                    break;
                }
            } {
                if (c[y][x] != a[y] + b[x]) {
                    isAns = false;
                    break;
                }
            } if (c[y][x] != a[y] + b[x]) {
                    isAns = false;
                    break;
                } c[y][x] != a[y] + b[x] c[y][x] c[y] c y x a[y] + b[x] a[y] a y b[x] b x {
                    isAns = false;
                    break;
                } isAns = false isAns false break; System.out.println(isAns ? "Yes" : "No") System.out.println System.out System System.out isAns ? "Yes" : "No" isAns "Yes" "No" String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int[][] c = new int[3][3];
        int[] a = new int[3];
        int[] b = new int[3];

        for (int y = 0; y < 3; y++) {
            for (int x = 0; x < 3; x++) {
                c[y][x] = sc.nextInt();
                if (y == 0)
                    b[x] = c[y][x];
                else
                    a[y] = c[y][x] - b[x];
            }
        }

        boolean isAns = true;
        for (int y = 0; y < 3; y++) {
            for (int x = 0; x < 3; x++) {
                if (c[y][x] != a[y] + b[x]) {
                    isAns = false;
                    break;
                }
            }
        }

        System.out.println(isAns ? "Yes" : "No");
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int[][] c = new int[3][3];
        int[] a = new int[3];
        int[] b = new int[3];

        for (int y = 0; y < 3; y++) {
            for (int x = 0; x < 3; x++) {
                c[y][x] = sc.nextInt();
                if (y == 0)
                    b[x] = c[y][x];
                else
                    a[y] = c[y][x] - b[x];
            }
        }

        boolean isAns = true;
        for (int y = 0; y < 3; y++) {
            for (int x = 0; x < 3; x++) {
                if (c[y][x] != a[y] + b[x]) {
                    isAns = false;
                    break;
                }
            }
        }

        System.out.println(isAns ? "Yes" : "No");
    }
} Main
import java.util.Scanner;

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

        int[][] c = new int[3][3];
        int[] a = new int[3];
        int[] b = new int[3];

        for (int y = 0; y < 3; y++) {
            for (int x = 0; x < 3; x++) {
                c[y][x] = sc.nextInt();
                if (y == 0)
                    b[x] = c[y][x];
                else
                    a[y] = c[y][x] - b[x];
            }
        }

        boolean isAns = true;
        for (int y = 0; y < 3; y++) {
            for (int x = 0; x < 3; x++) {
                if (c[y][x] != a[y] + b[x]) {
                    isAns = false;
                    break;
                }
            }
        }

        System.out.println(isAns ? "Yes" : "No");
    }
}
