import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Map;
import java.util.HashMap;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        int a1, a2, a3, b1, b2, b3;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int[][] grid = new int[3][3];
        String ans = "No";
        
        for (int i = 0; i < 3; i++) {
            String[] line = br.readLine().split(" ");
            for (int j = 0; j < 3; j++) {
                grid[i][j] = Integer.parseInt(line[j]);
            }
        }
        
        for (a1 = 0; a1 <= grid[0][0]; a1++) {
            b1 = grid[0][0] - a1;
            b2 = grid[0][1] - a1;
            b3 = grid[0][2] - a1;
            a2 = grid[1][0] - b1;
            a3 = grid[2][0] - b1;
            if (a2 + b2 == grid[1][1] && a2 + b3 == grid[1][2] && a3 + b2 == grid[2][1] && a3 + b3 == grid[2][2]) ans = "Yes";
        }
        
        
        System.out.println(ans);
    }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Map; Map java.util import java.util.HashMap; HashMap java.util import java.util.List; List java.util import java.util.ArrayList; ArrayList java.util import java.util.Collections; Collections java.util public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        int a1, a2, a3, b1, b2, b3;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int[][] grid = new int[3][3];
        String ans = "No";
        
        for (int i = 0; i < 3; i++) {
            String[] line = br.readLine().split(" ");
            for (int j = 0; j < 3; j++) {
                grid[i][j] = Integer.parseInt(line[j]);
            }
        }
        
        for (a1 = 0; a1 <= grid[0][0]; a1++) {
            b1 = grid[0][0] - a1;
            b2 = grid[0][1] - a1;
            b3 = grid[0][2] - a1;
            a2 = grid[1][0] - b1;
            a3 = grid[2][0] - b1;
            if (a2 + b2 == grid[1][1] && a2 + b3 == grid[1][2] && a3 + b2 == grid[2][1] && a3 + b3 == grid[2][2]) ans = "Yes";
        }
        
        
        System.out.println(ans);
    }
} Main public static void main(String[] args) throws Exception {
        // Your code here!
        int a1, a2, a3, b1, b2, b3;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int[][] grid = new int[3][3];
        String ans = "No";
        
        for (int i = 0; i < 3; i++) {
            String[] line = br.readLine().split(" ");
            for (int j = 0; j < 3; j++) {
                grid[i][j] = Integer.parseInt(line[j]);
            }
        }
        
        for (a1 = 0; a1 <= grid[0][0]; a1++) {
            b1 = grid[0][0] - a1;
            b2 = grid[0][1] - a1;
            b3 = grid[0][2] - a1;
            a2 = grid[1][0] - b1;
            a3 = grid[2][0] - b1;
            if (a2 + b2 == grid[1][1] && a2 + b3 == grid[1][2] && a3 + b2 == grid[2][1] && a3 + b3 == grid[2][2]) ans = "Yes";
        }
        
        
        System.out.println(ans);
    } main {
        // Your code here!
        int a1, a2, a3, b1, b2, b3;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int[][] grid = new int[3][3];
        String ans = "No";
        
        for (int i = 0; i < 3; i++) {
            String[] line = br.readLine().split(" ");
            for (int j = 0; j < 3; j++) {
                grid[i][j] = Integer.parseInt(line[j]);
            }
        }
        
        for (a1 = 0; a1 <= grid[0][0]; a1++) {
            b1 = grid[0][0] - a1;
            b2 = grid[0][1] - a1;
            b3 = grid[0][2] - a1;
            a2 = grid[1][0] - b1;
            a3 = grid[2][0] - b1;
            if (a2 + b2 == grid[1][1] && a2 + b3 == grid[1][2] && a3 + b2 == grid[2][1] && a3 + b3 == grid[2][2]) ans = "Yes";
        }
        
        
        System.out.println(ans);
    } int a1 a1 a2 a2 a3 a3 b1 b1 b2 b2 b3; b3 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int[][] grid = new int[3][3]; grid new int[3][3] 3 3 String ans = "No"; ans "No" for (int i = 0; i < 3; i++) {
            String[] line = br.readLine().split(" ");
            for (int j = 0; j < 3; j++) {
                grid[i][j] = Integer.parseInt(line[j]);
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            String[] line = br.readLine().split(" ");
            for (int j = 0; j < 3; j++) {
                grid[i][j] = Integer.parseInt(line[j]);
            }
        } {
            String[] line = br.readLine().split(" ");
            for (int j = 0; j < 3; j++) {
                grid[i][j] = Integer.parseInt(line[j]);
            }
        } String[] line = br.readLine().split(" "); line br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " for (int j = 0; j < 3; j++) {
                grid[i][j] = Integer.parseInt(line[j]);
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                grid[i][j] = Integer.parseInt(line[j]);
            } {
                grid[i][j] = Integer.parseInt(line[j]);
            } grid[i][j] = Integer.parseInt(line[j]) grid[i][j] grid[i] grid i j Integer.parseInt(line[j]) Integer.parseInt Integer line[j] line j for (a1 = 0; a1 <= grid[0][0]; a1++) {
            b1 = grid[0][0] - a1;
            b2 = grid[0][1] - a1;
            b3 = grid[0][2] - a1;
            a2 = grid[1][0] - b1;
            a3 = grid[2][0] - b1;
            if (a2 + b2 == grid[1][1] && a2 + b3 == grid[1][2] && a3 + b2 == grid[2][1] && a3 + b3 == grid[2][2]) ans = "Yes";
        } a1 = 0; a1 = 0 a1 0 a1 <= grid[0][0] a1 grid[0][0] grid[0] grid 0 0 a1++ a1++ a1 {
            b1 = grid[0][0] - a1;
            b2 = grid[0][1] - a1;
            b3 = grid[0][2] - a1;
            a2 = grid[1][0] - b1;
            a3 = grid[2][0] - b1;
            if (a2 + b2 == grid[1][1] && a2 + b3 == grid[1][2] && a3 + b2 == grid[2][1] && a3 + b3 == grid[2][2]) ans = "Yes";
        } {
            b1 = grid[0][0] - a1;
            b2 = grid[0][1] - a1;
            b3 = grid[0][2] - a1;
            a2 = grid[1][0] - b1;
            a3 = grid[2][0] - b1;
            if (a2 + b2 == grid[1][1] && a2 + b3 == grid[1][2] && a3 + b2 == grid[2][1] && a3 + b3 == grid[2][2]) ans = "Yes";
        } b1 = grid[0][0] - a1 b1 grid[0][0] - a1 grid[0][0] grid[0] grid 0 0 a1 b2 = grid[0][1] - a1 b2 grid[0][1] - a1 grid[0][1] grid[0] grid 0 1 a1 b3 = grid[0][2] - a1 b3 grid[0][2] - a1 grid[0][2] grid[0] grid 0 2 a1 a2 = grid[1][0] - b1 a2 grid[1][0] - b1 grid[1][0] grid[1] grid 1 0 b1 a3 = grid[2][0] - b1 a3 grid[2][0] - b1 grid[2][0] grid[2] grid 2 0 b1 if (a2 + b2 == grid[1][1] && a2 + b3 == grid[1][2] && a3 + b2 == grid[2][1] && a3 + b3 == grid[2][2]) ans = "Yes"; a2 + b2 == grid[1][1] && a2 + b3 == grid[1][2] && a3 + b2 == grid[2][1] && a3 + b3 == grid[2][2] a3 + b2 == grid[2][1] a2 + b2 == grid[1][1] && a2 + b3 == grid[1][2] && a3 + b2 == grid[2][1] && a3 + b3 == grid[2][2] a2 + b2 == grid[1][1] a2 + b2 a2 b2 grid[1][1] grid[1] grid 1 1 a2 + b3 == grid[1][2] a2 + b3 a2 b3 grid[1][2] grid[1] grid 1 2 a3 + b2 == grid[2][1] a3 + b2 a3 b2 grid[2][1] grid[2] grid 2 1 a3 + b3 == grid[2][2] a3 + b3 a3 b3 grid[2][2] grid[2] grid 2 2 ans = "Yes" ans "Yes" System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        int a1, a2, a3, b1, b2, b3;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int[][] grid = new int[3][3];
        String ans = "No";
        
        for (int i = 0; i < 3; i++) {
            String[] line = br.readLine().split(" ");
            for (int j = 0; j < 3; j++) {
                grid[i][j] = Integer.parseInt(line[j]);
            }
        }
        
        for (a1 = 0; a1 <= grid[0][0]; a1++) {
            b1 = grid[0][0] - a1;
            b2 = grid[0][1] - a1;
            b3 = grid[0][2] - a1;
            a2 = grid[1][0] - b1;
            a3 = grid[2][0] - b1;
            if (a2 + b2 == grid[1][1] && a2 + b3 == grid[1][2] && a3 + b2 == grid[2][1] && a3 + b3 == grid[2][2]) ans = "Yes";
        }
        
        
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        int a1, a2, a3, b1, b2, b3;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int[][] grid = new int[3][3];
        String ans = "No";
        
        for (int i = 0; i < 3; i++) {
            String[] line = br.readLine().split(" ");
            for (int j = 0; j < 3; j++) {
                grid[i][j] = Integer.parseInt(line[j]);
            }
        }
        
        for (a1 = 0; a1 <= grid[0][0]; a1++) {
            b1 = grid[0][0] - a1;
            b2 = grid[0][1] - a1;
            b3 = grid[0][2] - a1;
            a2 = grid[1][0] - b1;
            a3 = grid[2][0] - b1;
            if (a2 + b2 == grid[1][1] && a2 + b3 == grid[1][2] && a3 + b2 == grid[2][1] && a3 + b3 == grid[2][2]) ans = "Yes";
        }
        
        
        System.out.println(ans);
    }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Map;
import java.util.HashMap;
import java.util.List;
import java.util.ArrayList;
import java.util.Collections;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        int a1, a2, a3, b1, b2, b3;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int[][] grid = new int[3][3];
        String ans = "No";
        
        for (int i = 0; i < 3; i++) {
            String[] line = br.readLine().split(" ");
            for (int j = 0; j < 3; j++) {
                grid[i][j] = Integer.parseInt(line[j]);
            }
        }
        
        for (a1 = 0; a1 <= grid[0][0]; a1++) {
            b1 = grid[0][0] - a1;
            b2 = grid[0][1] - a1;
            b3 = grid[0][2] - a1;
            a2 = grid[1][0] - b1;
            a3 = grid[2][0] - b1;
            if (a2 + b2 == grid[1][1] && a2 + b3 == grid[1][2] && a3 + b2 == grid[2][1] && a3 + b3 == grid[2][2]) ans = "Yes";
        }
        
        
        System.out.println(ans);
    }
}
