import java.util.*;

public class Main {
    static char[][] c;
    public static void main(String[] args) throws InterruptedException {
        Scanner scan = new Scanner(System.in);
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = scan.nextInt();
            }
        }
        for (int i = 0; i < 3; i++) {
            if (c[i][0] - c[i][1] != c[0][0] - c[0][1] ||  c[i][1] - c[i][2] != c[0][1] - c[0][2]) {
                System.out.println("No");
                return;
            }
        }
        for (int i = 0; i < 3; i++) {
            if (c[0][i] - c[1][i] != c[0][0] - c[1][0]||  c[1][i] - c[2][i] != c[1][0] - c[2][0]) {
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    }
} import java.util.*; util.* java public class Main {
    static char[][] c;
    public static void main(String[] args) throws InterruptedException {
        Scanner scan = new Scanner(System.in);
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = scan.nextInt();
            }
        }
        for (int i = 0; i < 3; i++) {
            if (c[i][0] - c[i][1] != c[0][0] - c[0][1] ||  c[i][1] - c[i][2] != c[0][1] - c[0][2]) {
                System.out.println("No");
                return;
            }
        }
        for (int i = 0; i < 3; i++) {
            if (c[0][i] - c[1][i] != c[0][0] - c[1][0]||  c[1][i] - c[2][i] != c[1][0] - c[2][0]) {
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    }
} Main static char[][] c; c public static void main(String[] args) throws InterruptedException {
        Scanner scan = new Scanner(System.in);
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = scan.nextInt();
            }
        }
        for (int i = 0; i < 3; i++) {
            if (c[i][0] - c[i][1] != c[0][0] - c[0][1] ||  c[i][1] - c[i][2] != c[0][1] - c[0][2]) {
                System.out.println("No");
                return;
            }
        }
        for (int i = 0; i < 3; i++) {
            if (c[0][i] - c[1][i] != c[0][0] - c[1][0]||  c[1][i] - c[2][i] != c[1][0] - c[2][0]) {
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    } main {
        Scanner scan = new Scanner(System.in);
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = scan.nextInt();
            }
        }
        for (int i = 0; i < 3; i++) {
            if (c[i][0] - c[i][1] != c[0][0] - c[0][1] ||  c[i][1] - c[i][2] != c[0][1] - c[0][2]) {
                System.out.println("No");
                return;
            }
        }
        for (int i = 0; i < 3; i++) {
            if (c[0][i] - c[1][i] != c[0][0] - c[1][0]||  c[1][i] - c[2][i] != c[1][0] - c[2][0]) {
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.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] = scan.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] = scan.nextInt();
            }
        } {
            for (int j = 0; j < 3; j++) {
                c[i][j] = scan.nextInt();
            }
        } for (int j = 0; j < 3; j++) {
                c[i][j] = scan.nextInt();
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                c[i][j] = scan.nextInt();
            } {
                c[i][j] = scan.nextInt();
            } c[i][j] = scan.nextInt() c[i][j] c[i] c i j scan.nextInt() scan.nextInt scan for (int i = 0; i < 3; i++) {
            if (c[i][0] - c[i][1] != c[0][0] - c[0][1] ||  c[i][1] - c[i][2] != c[0][1] - c[0][2]) {
                System.out.println("No");
                return;
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            if (c[i][0] - c[i][1] != c[0][0] - c[0][1] ||  c[i][1] - c[i][2] != c[0][1] - c[0][2]) {
                System.out.println("No");
                return;
            }
        } {
            if (c[i][0] - c[i][1] != c[0][0] - c[0][1] ||  c[i][1] - c[i][2] != c[0][1] - c[0][2]) {
                System.out.println("No");
                return;
            }
        } if (c[i][0] - c[i][1] != c[0][0] - c[0][1] ||  c[i][1] - c[i][2] != c[0][1] - c[0][2]) {
                System.out.println("No");
                return;
            } c[i][0] - c[i][1] != c[0][0] - c[0][1] ||  c[i][1] - c[i][2] != c[0][1] - c[0][2] c[i][0] - c[i][1] != c[0][0] - c[0][1] c[i][0] - c[i][1] c[i][0] c[i] c i 0 c[i][1] c[i] c i 1 c[0][0] - c[0][1] c[0][0] c[0] c 0 0 c[0][1] c[0] c 0 1 c[i][1] - c[i][2] != c[0][1] - c[0][2] c[i][1] - c[i][2] c[i][1] c[i] c i 1 c[i][2] c[i] c i 2 c[0][1] - c[0][2] c[0][1] c[0] c 0 1 c[0][2] c[0] c 0 2 {
                System.out.println("No");
                return;
            } System.out.println("No") System.out.println System.out System System.out "No" return; for (int i = 0; i < 3; i++) {
            if (c[0][i] - c[1][i] != c[0][0] - c[1][0]||  c[1][i] - c[2][i] != c[1][0] - c[2][0]) {
                System.out.println("No");
                return;
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            if (c[0][i] - c[1][i] != c[0][0] - c[1][0]||  c[1][i] - c[2][i] != c[1][0] - c[2][0]) {
                System.out.println("No");
                return;
            }
        } {
            if (c[0][i] - c[1][i] != c[0][0] - c[1][0]||  c[1][i] - c[2][i] != c[1][0] - c[2][0]) {
                System.out.println("No");
                return;
            }
        } if (c[0][i] - c[1][i] != c[0][0] - c[1][0]||  c[1][i] - c[2][i] != c[1][0] - c[2][0]) {
                System.out.println("No");
                return;
            } c[0][i] - c[1][i] != c[0][0] - c[1][0]||  c[1][i] - c[2][i] != c[1][0] - c[2][0] c[0][i] - c[1][i] != c[0][0] - c[1][0] c[0][i] - c[1][i] c[0][i] c[0] c 0 i c[1][i] c[1] c 1 i c[0][0] - c[1][0] c[0][0] c[0] c 0 0 c[1][0] c[1] c 1 0 c[1][i] - c[2][i] != c[1][0] - c[2][0] c[1][i] - c[2][i] c[1][i] c[1] c 1 i c[2][i] c[2] c 2 i c[1][0] - c[2][0] c[1][0] c[1] c 1 0 c[2][0] c[2] c 2 0 {
                System.out.println("No");
                return;
            } System.out.println("No") System.out.println System.out System System.out "No" return; System.out.println("Yes") System.out.println System.out System System.out "Yes" String[] args args public class Main {
    static char[][] c;
    public static void main(String[] args) throws InterruptedException {
        Scanner scan = new Scanner(System.in);
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = scan.nextInt();
            }
        }
        for (int i = 0; i < 3; i++) {
            if (c[i][0] - c[i][1] != c[0][0] - c[0][1] ||  c[i][1] - c[i][2] != c[0][1] - c[0][2]) {
                System.out.println("No");
                return;
            }
        }
        for (int i = 0; i < 3; i++) {
            if (c[0][i] - c[1][i] != c[0][0] - c[1][0]||  c[1][i] - c[2][i] != c[1][0] - c[2][0]) {
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    }
} public class Main {
    static char[][] c;
    public static void main(String[] args) throws InterruptedException {
        Scanner scan = new Scanner(System.in);
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = scan.nextInt();
            }
        }
        for (int i = 0; i < 3; i++) {
            if (c[i][0] - c[i][1] != c[0][0] - c[0][1] ||  c[i][1] - c[i][2] != c[0][1] - c[0][2]) {
                System.out.println("No");
                return;
            }
        }
        for (int i = 0; i < 3; i++) {
            if (c[0][i] - c[1][i] != c[0][0] - c[1][0]||  c[1][i] - c[2][i] != c[1][0] - c[2][0]) {
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    }
} Main
import java.util.*;

public class Main {
    static char[][] c;
    public static void main(String[] args) throws InterruptedException {
        Scanner scan = new Scanner(System.in);
        int[][] c = new int[3][3];
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                c[i][j] = scan.nextInt();
            }
        }
        for (int i = 0; i < 3; i++) {
            if (c[i][0] - c[i][1] != c[0][0] - c[0][1] ||  c[i][1] - c[i][2] != c[0][1] - c[0][2]) {
                System.out.println("No");
                return;
            }
        }
        for (int i = 0; i < 3; i++) {
            if (c[0][i] - c[1][i] != c[0][0] - c[1][0]||  c[1][i] - c[2][i] != c[1][0] - c[2][0]) {
                System.out.println("No");
                return;
            }
        }
        System.out.println("Yes");
    }
}
