import java.util.*;

public class Main {
    public static void main(String[] args)  {
        Scanner scan = new Scanner(System.in);
        int[][] c = new int [3][3];
        for (int i = 0;i < 3; ++i){
            for (int k = 0;k < 3; ++k){
                c[i][k] = Integer.parseInt(scan.next());
            }
        }

        int[] x = new int [3];
        int[] y = new int [3];

        for (int i = 0;i < 3; ++i){
            y[i] = c[0][i]-x[0];
        }

        for (int i = 0;i < 3; ++i){
            x[i] = c[i][0]-y[0];
        }

        for (int i = 0;i < 3; ++i){
            for (int k = 0;k < 3; ++k){
                if (c[i][k] != x[i]+y[k]){
                    System.out.println("No");
                    return;
                }
            }
        }

        System.out.print("Yes");
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args)  {
        Scanner scan = new Scanner(System.in);
        int[][] c = new int [3][3];
        for (int i = 0;i < 3; ++i){
            for (int k = 0;k < 3; ++k){
                c[i][k] = Integer.parseInt(scan.next());
            }
        }

        int[] x = new int [3];
        int[] y = new int [3];

        for (int i = 0;i < 3; ++i){
            y[i] = c[0][i]-x[0];
        }

        for (int i = 0;i < 3; ++i){
            x[i] = c[i][0]-y[0];
        }

        for (int i = 0;i < 3; ++i){
            for (int k = 0;k < 3; ++k){
                if (c[i][k] != x[i]+y[k]){
                    System.out.println("No");
                    return;
                }
            }
        }

        System.out.print("Yes");
    }
} Main public static void main(String[] args)  {
        Scanner scan = new Scanner(System.in);
        int[][] c = new int [3][3];
        for (int i = 0;i < 3; ++i){
            for (int k = 0;k < 3; ++k){
                c[i][k] = Integer.parseInt(scan.next());
            }
        }

        int[] x = new int [3];
        int[] y = new int [3];

        for (int i = 0;i < 3; ++i){
            y[i] = c[0][i]-x[0];
        }

        for (int i = 0;i < 3; ++i){
            x[i] = c[i][0]-y[0];
        }

        for (int i = 0;i < 3; ++i){
            for (int k = 0;k < 3; ++k){
                if (c[i][k] != x[i]+y[k]){
                    System.out.println("No");
                    return;
                }
            }
        }

        System.out.print("Yes");
    } main {
        Scanner scan = new Scanner(System.in);
        int[][] c = new int [3][3];
        for (int i = 0;i < 3; ++i){
            for (int k = 0;k < 3; ++k){
                c[i][k] = Integer.parseInt(scan.next());
            }
        }

        int[] x = new int [3];
        int[] y = new int [3];

        for (int i = 0;i < 3; ++i){
            y[i] = c[0][i]-x[0];
        }

        for (int i = 0;i < 3; ++i){
            x[i] = c[i][0]-y[0];
        }

        for (int i = 0;i < 3; ++i){
            for (int k = 0;k < 3; ++k){
                if (c[i][k] != x[i]+y[k]){
                    System.out.println("No");
                    return;
                }
            }
        }

        System.out.print("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 k = 0;k < 3; ++k){
                c[i][k] = Integer.parseInt(scan.next());
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 ++i ++i i {
            for (int k = 0;k < 3; ++k){
                c[i][k] = Integer.parseInt(scan.next());
            }
        } {
            for (int k = 0;k < 3; ++k){
                c[i][k] = Integer.parseInt(scan.next());
            }
        } for (int k = 0;k < 3; ++k){
                c[i][k] = Integer.parseInt(scan.next());
            } int k = 0; int k = 0; k 0 k < 3 k 3 ++k ++k k {
                c[i][k] = Integer.parseInt(scan.next());
            } {
                c[i][k] = Integer.parseInt(scan.next());
            } c[i][k] = Integer.parseInt(scan.next()) c[i][k] c[i] c i k Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan int[] x = new int [3]; x new int [3] 3 int[] y = new int [3]; y new int [3] 3 for (int i = 0;i < 3; ++i){
            y[i] = c[0][i]-x[0];
        } int i = 0; int i = 0; i 0 i < 3 i 3 ++i ++i i {
            y[i] = c[0][i]-x[0];
        } {
            y[i] = c[0][i]-x[0];
        } y[i] = c[0][i]-x[0] y[i] y i c[0][i]-x[0] c[0][i] c[0] c 0 i x[0] x 0 for (int i = 0;i < 3; ++i){
            x[i] = c[i][0]-y[0];
        } int i = 0; int i = 0; i 0 i < 3 i 3 ++i ++i i {
            x[i] = c[i][0]-y[0];
        } {
            x[i] = c[i][0]-y[0];
        } x[i] = c[i][0]-y[0] x[i] x i c[i][0]-y[0] c[i][0] c[i] c i 0 y[0] y 0 for (int i = 0;i < 3; ++i){
            for (int k = 0;k < 3; ++k){
                if (c[i][k] != x[i]+y[k]){
                    System.out.println("No");
                    return;
                }
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 ++i ++i i {
            for (int k = 0;k < 3; ++k){
                if (c[i][k] != x[i]+y[k]){
                    System.out.println("No");
                    return;
                }
            }
        } {
            for (int k = 0;k < 3; ++k){
                if (c[i][k] != x[i]+y[k]){
                    System.out.println("No");
                    return;
                }
            }
        } for (int k = 0;k < 3; ++k){
                if (c[i][k] != x[i]+y[k]){
                    System.out.println("No");
                    return;
                }
            } int k = 0; int k = 0; k 0 k < 3 k 3 ++k ++k k {
                if (c[i][k] != x[i]+y[k]){
                    System.out.println("No");
                    return;
                }
            } {
                if (c[i][k] != x[i]+y[k]){
                    System.out.println("No");
                    return;
                }
            } if (c[i][k] != x[i]+y[k]){
                    System.out.println("No");
                    return;
                } c[i][k] != x[i]+y[k] c[i][k] c[i] c i k x[i]+y[k] x[i] x i y[k] y k {
                    System.out.println("No");
                    return;
                } System.out.println("No") System.out.println System.out System System.out "No" return; System.out.print("Yes") System.out.print System.out System System.out "Yes" String[] args args public class Main {
    public static void main(String[] args)  {
        Scanner scan = new Scanner(System.in);
        int[][] c = new int [3][3];
        for (int i = 0;i < 3; ++i){
            for (int k = 0;k < 3; ++k){
                c[i][k] = Integer.parseInt(scan.next());
            }
        }

        int[] x = new int [3];
        int[] y = new int [3];

        for (int i = 0;i < 3; ++i){
            y[i] = c[0][i]-x[0];
        }

        for (int i = 0;i < 3; ++i){
            x[i] = c[i][0]-y[0];
        }

        for (int i = 0;i < 3; ++i){
            for (int k = 0;k < 3; ++k){
                if (c[i][k] != x[i]+y[k]){
                    System.out.println("No");
                    return;
                }
            }
        }

        System.out.print("Yes");
    }
} public class Main {
    public static void main(String[] args)  {
        Scanner scan = new Scanner(System.in);
        int[][] c = new int [3][3];
        for (int i = 0;i < 3; ++i){
            for (int k = 0;k < 3; ++k){
                c[i][k] = Integer.parseInt(scan.next());
            }
        }

        int[] x = new int [3];
        int[] y = new int [3];

        for (int i = 0;i < 3; ++i){
            y[i] = c[0][i]-x[0];
        }

        for (int i = 0;i < 3; ++i){
            x[i] = c[i][0]-y[0];
        }

        for (int i = 0;i < 3; ++i){
            for (int k = 0;k < 3; ++k){
                if (c[i][k] != x[i]+y[k]){
                    System.out.println("No");
                    return;
                }
            }
        }

        System.out.print("Yes");
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args)  {
        Scanner scan = new Scanner(System.in);
        int[][] c = new int [3][3];
        for (int i = 0;i < 3; ++i){
            for (int k = 0;k < 3; ++k){
                c[i][k] = Integer.parseInt(scan.next());
            }
        }

        int[] x = new int [3];
        int[] y = new int [3];

        for (int i = 0;i < 3; ++i){
            y[i] = c[0][i]-x[0];
        }

        for (int i = 0;i < 3; ++i){
            x[i] = c[i][0]-y[0];
        }

        for (int i = 0;i < 3; ++i){
            for (int k = 0;k < 3; ++k){
                if (c[i][k] != x[i]+y[k]){
                    System.out.println("No");
                    return;
                }
            }
        }

        System.out.print("Yes");
    }
}