import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = 3;
        int[][] t = new int[n][n];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                t[i][j] = sc.nextInt();
            }
        }
        
        for (int i = 0; i < n - 1; i++) {
            int dif0 = t[i][0] - t[i + 1][0];
            for (int j = 1; j < n; j++) {
                int difj = t[i][j] - t[i + 1][j];
                if (dif0 != difj) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        for (int j = 0; j < n - 1; j++) {
            int dif0 = t[0][j] - t[0][j + 1];
            for (int i = 1; i < n; i++) {
                int difi = t[i][j] - t[i][j + 1];
                if (dif0 != difi) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        System.out.println("Yes");
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = 3;
        int[][] t = new int[n][n];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                t[i][j] = sc.nextInt();
            }
        }
        
        for (int i = 0; i < n - 1; i++) {
            int dif0 = t[i][0] - t[i + 1][0];
            for (int j = 1; j < n; j++) {
                int difj = t[i][j] - t[i + 1][j];
                if (dif0 != difj) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        for (int j = 0; j < n - 1; j++) {
            int dif0 = t[0][j] - t[0][j + 1];
            for (int i = 1; i < n; i++) {
                int difi = t[i][j] - t[i][j + 1];
                if (dif0 != difi) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        System.out.println("Yes");
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = 3;
        int[][] t = new int[n][n];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                t[i][j] = sc.nextInt();
            }
        }
        
        for (int i = 0; i < n - 1; i++) {
            int dif0 = t[i][0] - t[i + 1][0];
            for (int j = 1; j < n; j++) {
                int difj = t[i][j] - t[i + 1][j];
                if (dif0 != difj) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        for (int j = 0; j < n - 1; j++) {
            int dif0 = t[0][j] - t[0][j + 1];
            for (int i = 1; i < n; i++) {
                int difi = t[i][j] - t[i][j + 1];
                if (dif0 != difi) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        System.out.println("Yes");
    } main {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = 3;
        int[][] t = new int[n][n];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                t[i][j] = sc.nextInt();
            }
        }
        
        for (int i = 0; i < n - 1; i++) {
            int dif0 = t[i][0] - t[i + 1][0];
            for (int j = 1; j < n; j++) {
                int difj = t[i][j] - t[i + 1][j];
                if (dif0 != difj) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        for (int j = 0; j < n - 1; j++) {
            int dif0 = t[0][j] - t[0][j + 1];
            for (int i = 1; i < n; i++) {
                int difi = t[i][j] - t[i][j + 1];
                if (dif0 != difi) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        System.out.println("Yes");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = 3; n 3 int[][] t = new int[n][n]; t new int[n][n] n n for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                t[i][j] = sc.nextInt();
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            for (int j = 0; j < n; j++) {
                t[i][j] = sc.nextInt();
            }
        } {
            for (int j = 0; j < n; j++) {
                t[i][j] = sc.nextInt();
            }
        } for (int j = 0; j < n; j++) {
                t[i][j] = sc.nextInt();
            } int j = 0; int j = 0; j 0 j < n j n j++ j++ j {
                t[i][j] = sc.nextInt();
            } {
                t[i][j] = sc.nextInt();
            } t[i][j] = sc.nextInt() t[i][j] t[i] t i j sc.nextInt() sc.nextInt sc for (int i = 0; i < n - 1; i++) {
            int dif0 = t[i][0] - t[i + 1][0];
            for (int j = 1; j < n; j++) {
                int difj = t[i][j] - t[i + 1][j];
                if (dif0 != difj) {
                    System.out.println("No");
                    return;
                }
            }
        } int i = 0; int i = 0; i 0 i < n - 1 i n - 1 n 1 i++ i++ i {
            int dif0 = t[i][0] - t[i + 1][0];
            for (int j = 1; j < n; j++) {
                int difj = t[i][j] - t[i + 1][j];
                if (dif0 != difj) {
                    System.out.println("No");
                    return;
                }
            }
        } {
            int dif0 = t[i][0] - t[i + 1][0];
            for (int j = 1; j < n; j++) {
                int difj = t[i][j] - t[i + 1][j];
                if (dif0 != difj) {
                    System.out.println("No");
                    return;
                }
            }
        } int dif0 = t[i][0] - t[i + 1][0]; dif0 t[i][0] - t[i + 1][0] t[i][0] t[i] t i 0 t[i + 1][0] t[i + 1] t i + 1 i 1 0 for (int j = 1; j < n; j++) {
                int difj = t[i][j] - t[i + 1][j];
                if (dif0 != difj) {
                    System.out.println("No");
                    return;
                }
            } int j = 1; int j = 1; j 1 j < n j n j++ j++ j {
                int difj = t[i][j] - t[i + 1][j];
                if (dif0 != difj) {
                    System.out.println("No");
                    return;
                }
            } {
                int difj = t[i][j] - t[i + 1][j];
                if (dif0 != difj) {
                    System.out.println("No");
                    return;
                }
            } int difj = t[i][j] - t[i + 1][j]; difj t[i][j] - t[i + 1][j] t[i][j] t[i] t i j t[i + 1][j] t[i + 1] t i + 1 i 1 j if (dif0 != difj) {
                    System.out.println("No");
                    return;
                } dif0 != difj dif0 difj {
                    System.out.println("No");
                    return;
                } System.out.println("No") System.out.println System.out System System.out "No" return; for (int j = 0; j < n - 1; j++) {
            int dif0 = t[0][j] - t[0][j + 1];
            for (int i = 1; i < n; i++) {
                int difi = t[i][j] - t[i][j + 1];
                if (dif0 != difi) {
                    System.out.println("No");
                    return;
                }
            }
        } int j = 0; int j = 0; j 0 j < n - 1 j n - 1 n 1 j++ j++ j {
            int dif0 = t[0][j] - t[0][j + 1];
            for (int i = 1; i < n; i++) {
                int difi = t[i][j] - t[i][j + 1];
                if (dif0 != difi) {
                    System.out.println("No");
                    return;
                }
            }
        } {
            int dif0 = t[0][j] - t[0][j + 1];
            for (int i = 1; i < n; i++) {
                int difi = t[i][j] - t[i][j + 1];
                if (dif0 != difi) {
                    System.out.println("No");
                    return;
                }
            }
        } int dif0 = t[0][j] - t[0][j + 1]; dif0 t[0][j] - t[0][j + 1] t[0][j] t[0] t 0 j t[0][j + 1] t[0] t 0 j + 1 j 1 for (int i = 1; i < n; i++) {
                int difi = t[i][j] - t[i][j + 1];
                if (dif0 != difi) {
                    System.out.println("No");
                    return;
                }
            } int i = 1; int i = 1; i 1 i < n i n i++ i++ i {
                int difi = t[i][j] - t[i][j + 1];
                if (dif0 != difi) {
                    System.out.println("No");
                    return;
                }
            } {
                int difi = t[i][j] - t[i][j + 1];
                if (dif0 != difi) {
                    System.out.println("No");
                    return;
                }
            } int difi = t[i][j] - t[i][j + 1]; difi t[i][j] - t[i][j + 1] t[i][j] t[i] t i j t[i][j + 1] t[i] t i j + 1 j 1 if (dif0 != difi) {
                    System.out.println("No");
                    return;
                } dif0 != difi dif0 difi {
                    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 {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = 3;
        int[][] t = new int[n][n];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                t[i][j] = sc.nextInt();
            }
        }
        
        for (int i = 0; i < n - 1; i++) {
            int dif0 = t[i][0] - t[i + 1][0];
            for (int j = 1; j < n; j++) {
                int difj = t[i][j] - t[i + 1][j];
                if (dif0 != difj) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        for (int j = 0; j < n - 1; j++) {
            int dif0 = t[0][j] - t[0][j + 1];
            for (int i = 1; i < n; i++) {
                int difi = t[i][j] - t[i][j + 1];
                if (dif0 != difi) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        System.out.println("Yes");
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = 3;
        int[][] t = new int[n][n];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                t[i][j] = sc.nextInt();
            }
        }
        
        for (int i = 0; i < n - 1; i++) {
            int dif0 = t[i][0] - t[i + 1][0];
            for (int j = 1; j < n; j++) {
                int difj = t[i][j] - t[i + 1][j];
                if (dif0 != difj) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        for (int j = 0; j < n - 1; j++) {
            int dif0 = t[0][j] - t[0][j + 1];
            for (int i = 1; i < n; i++) {
                int difi = t[i][j] - t[i][j + 1];
                if (dif0 != difi) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        System.out.println("Yes");
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int n = 3;
        int[][] t = new int[n][n];
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                t[i][j] = sc.nextInt();
            }
        }
        
        for (int i = 0; i < n - 1; i++) {
            int dif0 = t[i][0] - t[i + 1][0];
            for (int j = 1; j < n; j++) {
                int difj = t[i][j] - t[i + 1][j];
                if (dif0 != difj) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        for (int j = 0; j < n - 1; j++) {
            int dif0 = t[0][j] - t[0][j + 1];
            for (int i = 1; i < n; i++) {
                int difi = t[i][j] - t[i][j + 1];
                if (dif0 != difi) {
                    System.out.println("No");
                    return;
                }
            }
        }
        
        System.out.println("Yes");
    }
}
