import java.util.Scanner;

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

        int c11 = sc.nextInt();
        int c12 = sc.nextInt();
        int c13 = sc.nextInt();
        int c21 = sc.nextInt();
        int c22 = sc.nextInt();
        int c23 = sc.nextInt();
        int c31 = sc.nextInt();
        int c32 = sc.nextInt();
        int c33 = sc.nextInt();
        
        int diff21 = c21 - c11;
        int diff31 = c31 - c11;
        
        if (c22 - c12 == diff21 && c23 - c13 == diff21 &&
            c32 - c12 == diff31 && c33 - c13 == diff31) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int c11 = sc.nextInt();
        int c12 = sc.nextInt();
        int c13 = sc.nextInt();
        int c21 = sc.nextInt();
        int c22 = sc.nextInt();
        int c23 = sc.nextInt();
        int c31 = sc.nextInt();
        int c32 = sc.nextInt();
        int c33 = sc.nextInt();
        
        int diff21 = c21 - c11;
        int diff31 = c31 - c11;
        
        if (c22 - c12 == diff21 && c23 - c13 == diff21 &&
            c32 - c12 == diff31 && c33 - c13 == diff31) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int c11 = sc.nextInt();
        int c12 = sc.nextInt();
        int c13 = sc.nextInt();
        int c21 = sc.nextInt();
        int c22 = sc.nextInt();
        int c23 = sc.nextInt();
        int c31 = sc.nextInt();
        int c32 = sc.nextInt();
        int c33 = sc.nextInt();
        
        int diff21 = c21 - c11;
        int diff31 = c31 - c11;
        
        if (c22 - c12 == diff21 && c23 - c13 == diff21 &&
            c32 - c12 == diff31 && c33 - c13 == diff31) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    } main {
        Scanner sc = new Scanner(System.in);

        int c11 = sc.nextInt();
        int c12 = sc.nextInt();
        int c13 = sc.nextInt();
        int c21 = sc.nextInt();
        int c22 = sc.nextInt();
        int c23 = sc.nextInt();
        int c31 = sc.nextInt();
        int c32 = sc.nextInt();
        int c33 = sc.nextInt();
        
        int diff21 = c21 - c11;
        int diff31 = c31 - c11;
        
        if (c22 - c12 == diff21 && c23 - c13 == diff21 &&
            c32 - c12 == diff31 && c33 - c13 == diff31) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int c11 = sc.nextInt(); c11 sc.nextInt() sc.nextInt sc int c12 = sc.nextInt(); c12 sc.nextInt() sc.nextInt sc int c13 = sc.nextInt(); c13 sc.nextInt() sc.nextInt sc int c21 = sc.nextInt(); c21 sc.nextInt() sc.nextInt sc int c22 = sc.nextInt(); c22 sc.nextInt() sc.nextInt sc int c23 = sc.nextInt(); c23 sc.nextInt() sc.nextInt sc int c31 = sc.nextInt(); c31 sc.nextInt() sc.nextInt sc int c32 = sc.nextInt(); c32 sc.nextInt() sc.nextInt sc int c33 = sc.nextInt(); c33 sc.nextInt() sc.nextInt sc int diff21 = c21 - c11; diff21 c21 - c11 c21 c11 int diff31 = c31 - c11; diff31 c31 - c11 c31 c11 if (c22 - c12 == diff21 && c23 - c13 == diff21 &&
            c32 - c12 == diff31 && c33 - c13 == diff31) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        } c22 - c12 == diff21 && c23 - c13 == diff21 &&
            c32 - c12 == diff31 && c33 - c13 == diff31 c32 - c12 == diff31 c22 - c12 == diff21 && c23 - c13 == diff21 &&
            c32 - c12 == diff31 && c33 - c13 == diff31 c22 - c12 == diff21 c22 - c12 c22 c12 diff21 c23 - c13 == diff21 c23 - c13 c23 c13 diff21 c32 - c12 == diff31 c32 - c12 c32 c12 diff31 c33 - c13 == diff31 c33 - c13 c33 c13 diff31 {
            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 sc = new Scanner(System.in);

        int c11 = sc.nextInt();
        int c12 = sc.nextInt();
        int c13 = sc.nextInt();
        int c21 = sc.nextInt();
        int c22 = sc.nextInt();
        int c23 = sc.nextInt();
        int c31 = sc.nextInt();
        int c32 = sc.nextInt();
        int c33 = sc.nextInt();
        
        int diff21 = c21 - c11;
        int diff31 = c31 - c11;
        
        if (c22 - c12 == diff21 && c23 - c13 == diff21 &&
            c32 - c12 == diff31 && c33 - c13 == diff31) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int c11 = sc.nextInt();
        int c12 = sc.nextInt();
        int c13 = sc.nextInt();
        int c21 = sc.nextInt();
        int c22 = sc.nextInt();
        int c23 = sc.nextInt();
        int c31 = sc.nextInt();
        int c32 = sc.nextInt();
        int c33 = sc.nextInt();
        
        int diff21 = c21 - c11;
        int diff31 = c31 - c11;
        
        if (c22 - c12 == diff21 && c23 - c13 == diff21 &&
            c32 - c12 == diff31 && c33 - c13 == diff31) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
} Main
import java.util.Scanner;

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

        int c11 = sc.nextInt();
        int c12 = sc.nextInt();
        int c13 = sc.nextInt();
        int c21 = sc.nextInt();
        int c22 = sc.nextInt();
        int c23 = sc.nextInt();
        int c31 = sc.nextInt();
        int c32 = sc.nextInt();
        int c33 = sc.nextInt();
        
        int diff21 = c21 - c11;
        int diff31 = c31 - c11;
        
        if (c22 - c12 == diff21 && c23 - c13 == diff21 &&
            c32 - c12 == diff31 && c33 - c13 == diff31) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}