import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int e = sc.nextInt();
        int f = sc.nextInt();
        int g = sc.nextInt();
        int h = sc.nextInt();
        int i = sc.nextInt();
        boolean ok = false;
        for (int x = -100; x <= 100; x++) {
            if (a + x == d && b + x == e && c + x == f) {
                ok = true;
                break;
            }
        }
        if (!ok) {
            System.out.println("No");
            return;
        }
        ok = false;
        for (int x = -100; x <= 100; x++) {
            if (g + x == d && h + x == e && i + x == f) {
                ok = true;
                break;
            }
        }
        if (!ok) {
            System.out.println("No");
        } else {
            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 a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int e = sc.nextInt();
        int f = sc.nextInt();
        int g = sc.nextInt();
        int h = sc.nextInt();
        int i = sc.nextInt();
        boolean ok = false;
        for (int x = -100; x <= 100; x++) {
            if (a + x == d && b + x == e && c + x == f) {
                ok = true;
                break;
            }
        }
        if (!ok) {
            System.out.println("No");
            return;
        }
        ok = false;
        for (int x = -100; x <= 100; x++) {
            if (g + x == d && h + x == e && i + x == f) {
                ok = true;
                break;
            }
        }
        if (!ok) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int e = sc.nextInt();
        int f = sc.nextInt();
        int g = sc.nextInt();
        int h = sc.nextInt();
        int i = sc.nextInt();
        boolean ok = false;
        for (int x = -100; x <= 100; x++) {
            if (a + x == d && b + x == e && c + x == f) {
                ok = true;
                break;
            }
        }
        if (!ok) {
            System.out.println("No");
            return;
        }
        ok = false;
        for (int x = -100; x <= 100; x++) {
            if (g + x == d && h + x == e && i + x == f) {
                ok = true;
                break;
            }
        }
        if (!ok) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    } main {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int e = sc.nextInt();
        int f = sc.nextInt();
        int g = sc.nextInt();
        int h = sc.nextInt();
        int i = sc.nextInt();
        boolean ok = false;
        for (int x = -100; x <= 100; x++) {
            if (a + x == d && b + x == e && c + x == f) {
                ok = true;
                break;
            }
        }
        if (!ok) {
            System.out.println("No");
            return;
        }
        ok = false;
        for (int x = -100; x <= 100; x++) {
            if (g + x == d && h + x == e && i + x == f) {
                ok = true;
                break;
            }
        }
        if (!ok) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int c = sc.nextInt(); c sc.nextInt() sc.nextInt sc int d = sc.nextInt(); d sc.nextInt() sc.nextInt sc int e = sc.nextInt(); e sc.nextInt() sc.nextInt sc int f = sc.nextInt(); f sc.nextInt() sc.nextInt sc int g = sc.nextInt(); g sc.nextInt() sc.nextInt sc int h = sc.nextInt(); h sc.nextInt() sc.nextInt sc int i = sc.nextInt(); i sc.nextInt() sc.nextInt sc boolean ok = false; ok false for (int x = -100; x <= 100; x++) {
            if (a + x == d && b + x == e && c + x == f) {
                ok = true;
                break;
            }
        } int x = -100; int x = -100; x -100 100 x <= 100 x 100 x++ x++ x {
            if (a + x == d && b + x == e && c + x == f) {
                ok = true;
                break;
            }
        } {
            if (a + x == d && b + x == e && c + x == f) {
                ok = true;
                break;
            }
        } if (a + x == d && b + x == e && c + x == f) {
                ok = true;
                break;
            } a + x == d && b + x == e && c + x == f a + x == d && b + x == e && c + x == f a + x == d a + x a x d b + x == e b + x b x e c + x == f c + x c x f {
                ok = true;
                break;
            } ok = true ok true break; if (!ok) {
            System.out.println("No");
            return;
        } !ok ok {
            System.out.println("No");
            return;
        } System.out.println("No") System.out.println System.out System System.out "No" return; ok = false ok false for (int x = -100; x <= 100; x++) {
            if (g + x == d && h + x == e && i + x == f) {
                ok = true;
                break;
            }
        } int x = -100; int x = -100; x -100 100 x <= 100 x 100 x++ x++ x {
            if (g + x == d && h + x == e && i + x == f) {
                ok = true;
                break;
            }
        } {
            if (g + x == d && h + x == e && i + x == f) {
                ok = true;
                break;
            }
        } if (g + x == d && h + x == e && i + x == f) {
                ok = true;
                break;
            } g + x == d && h + x == e && i + x == f g + x == d && h + x == e && i + x == f g + x == d g + x g x d h + x == e h + x h x e i + x == f i + x i x f {
                ok = true;
                break;
            } ok = true ok true break; if (!ok) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        } !ok ok {
            System.out.println("No");
        } System.out.println("No") System.out.println System.out System System.out "No" {
            System.out.println("Yes");
        } 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 a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int e = sc.nextInt();
        int f = sc.nextInt();
        int g = sc.nextInt();
        int h = sc.nextInt();
        int i = sc.nextInt();
        boolean ok = false;
        for (int x = -100; x <= 100; x++) {
            if (a + x == d && b + x == e && c + x == f) {
                ok = true;
                break;
            }
        }
        if (!ok) {
            System.out.println("No");
            return;
        }
        ok = false;
        for (int x = -100; x <= 100; x++) {
            if (g + x == d && h + x == e && i + x == f) {
                ok = true;
                break;
            }
        }
        if (!ok) {
            System.out.println("No");
        } else {
            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 a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int e = sc.nextInt();
        int f = sc.nextInt();
        int g = sc.nextInt();
        int h = sc.nextInt();
        int i = sc.nextInt();
        boolean ok = false;
        for (int x = -100; x <= 100; x++) {
            if (a + x == d && b + x == e && c + x == f) {
                ok = true;
                break;
            }
        }
        if (!ok) {
            System.out.println("No");
            return;
        }
        ok = false;
        for (int x = -100; x <= 100; x++) {
            if (g + x == d && h + x == e && i + x == f) {
                ok = true;
                break;
            }
        }
        if (!ok) {
            System.out.println("No");
        } else {
            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 a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        int e = sc.nextInt();
        int f = sc.nextInt();
        int g = sc.nextInt();
        int h = sc.nextInt();
        int i = sc.nextInt();
        boolean ok = false;
        for (int x = -100; x <= 100; x++) {
            if (a + x == d && b + x == e && c + x == f) {
                ok = true;
                break;
            }
        }
        if (!ok) {
            System.out.println("No");
            return;
        }
        ok = false;
        for (int x = -100; x <= 100; x++) {
            if (g + x == d && h + x == e && i + x == f) {
                ok = true;
                break;
            }
        }
        if (!ok) {
            System.out.println("No");
        } else {
            System.out.println("Yes");
        }
    }
}
