import java.io.BufferedReader;
import java.io.InputStreamReader;

import java.util.Arrays;
import java.util.Collections;
import java.util.ArrayList;
import java.util.List;
import java.util.HashSet;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.util.Comparator;
import java.util.Set;
import java.util.HashMap;
import java.util.Map;

public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用 int
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    // 標準入力数値リスト用 int
    static List<Integer> inputIntList() throws Exception {
        List<String> strList = Arrays.asList(br.readLine().trim().split(" "));
        List<Integer> intList = new ArrayList<Integer>();
        for (String elem : strList){
            intList.add(Integer.parseInt(elem));
        }
        return intList;
    }

    // 標準入力数値配列用 integer 降順ソート用
    static Integer[] inputvalInteger() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    public static void main(String[] args) throws Exception {
        // write your code here
        int [] c1 = inputval();
        int [] c2 = inputval();
        int [] c3 = inputval();
        int c1Sum = Arrays.stream(c1).sum();
        int c2Sum = Arrays.stream(c2).sum();
        int c3Sum = Arrays.stream(c3).sum();
        int b1row = c1[0] + c2[0] + c3[0];
        int b2row = c1[1] + c2[1] + c3[1];
        int b3row = c1[2] + c2[2] + c3[2];

        boolean isAcorrect = Math.abs(c2Sum-c1Sum) %3 == 0 && Math.abs(c3Sum-c1Sum) %3 == 0 && Math.abs(c3Sum-c2Sum) %3 == 0;
        boolean isBcorrect = Math.abs(b2row-b1row) %3 == 0 && Math.abs(b3row-b1row) %3 == 0 && Math.abs(b3row-b2row) %3 == 0;
        if (isAcorrect && isBcorrect){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }

    }

}
 import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util import java.util.ArrayList; ArrayList java.util import java.util.List; List java.util import java.util.HashSet; HashSet java.util import java.io.PrintWriter; PrintWriter java.io import java.io.OutputStream; OutputStream java.io import java.util.Comparator; Comparator java.util import java.util.Set; Set java.util import java.util.HashMap; HashMap java.util import java.util.Map; Map java.util public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用 int
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    // 標準入力数値リスト用 int
    static List<Integer> inputIntList() throws Exception {
        List<String> strList = Arrays.asList(br.readLine().trim().split(" "));
        List<Integer> intList = new ArrayList<Integer>();
        for (String elem : strList){
            intList.add(Integer.parseInt(elem));
        }
        return intList;
    }

    // 標準入力数値配列用 integer 降順ソート用
    static Integer[] inputvalInteger() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    public static void main(String[] args) throws Exception {
        // write your code here
        int [] c1 = inputval();
        int [] c2 = inputval();
        int [] c3 = inputval();
        int c1Sum = Arrays.stream(c1).sum();
        int c2Sum = Arrays.stream(c2).sum();
        int c3Sum = Arrays.stream(c3).sum();
        int b1row = c1[0] + c2[0] + c3[0];
        int b2row = c1[1] + c2[1] + c3[1];
        int b3row = c1[2] + c2[2] + c3[2];

        boolean isAcorrect = Math.abs(c2Sum-c1Sum) %3 == 0 && Math.abs(c3Sum-c1Sum) %3 == 0 && Math.abs(c3Sum-c2Sum) %3 == 0;
        boolean isBcorrect = Math.abs(b2row-b1row) %3 == 0 && Math.abs(b3row-b1row) %3 == 0 && Math.abs(b3row-b2row) %3 == 0;
        if (isAcorrect && isBcorrect){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }

    }

} Main // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) // 標準入力数値配列用 int
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    } inputval {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    } String[] strarray = br.readLine().trim().split(" "); strarray br.readLine().trim().split(" ") br.readLine().trim().split br.readLine().trim() br.readLine().trim br.readLine() br.readLine br " " int[] intarray = new int[strarray.length]; intarray new int[strarray.length] strarray.length strarray strarray.length for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        } int i = 0; int i = 0; i 0 i < intarray.length i intarray.length intarray intarray.length i++ i++ i {
            intarray[i] = Integer.parseInt(strarray[i]);
        } {
            intarray[i] = Integer.parseInt(strarray[i]);
        } intarray[i] = Integer.parseInt(strarray[i]) intarray[i] intarray i Integer.parseInt(strarray[i]) Integer.parseInt Integer strarray[i] strarray i return intarray; intarray // 標準入力数値リスト用 int
    static List<Integer> inputIntList() throws Exception {
        List<String> strList = Arrays.asList(br.readLine().trim().split(" "));
        List<Integer> intList = new ArrayList<Integer>();
        for (String elem : strList){
            intList.add(Integer.parseInt(elem));
        }
        return intList;
    } inputIntList {
        List<String> strList = Arrays.asList(br.readLine().trim().split(" "));
        List<Integer> intList = new ArrayList<Integer>();
        for (String elem : strList){
            intList.add(Integer.parseInt(elem));
        }
        return intList;
    } List<String> strList = Arrays.asList(br.readLine().trim().split(" ")); strList Arrays.asList(br.readLine().trim().split(" ")) Arrays.asList Arrays br.readLine().trim().split(" ") br.readLine().trim().split br.readLine().trim() br.readLine().trim br.readLine() br.readLine br " " List<Integer> intList = new ArrayList<Integer>(); intList new ArrayList<Integer>() for (String elem : strList){
            intList.add(Integer.parseInt(elem));
        } String elem strList {
            intList.add(Integer.parseInt(elem));
        } {
            intList.add(Integer.parseInt(elem));
        } intList.add(Integer.parseInt(elem)) intList.add intList Integer.parseInt(elem) Integer.parseInt Integer elem return intList; intList // 標準入力数値配列用 integer 降順ソート用
    static Integer[] inputvalInteger() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    } inputvalInteger {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    } String[] strarray = br.readLine().trim().split(" "); strarray br.readLine().trim().split(" ") br.readLine().trim().split br.readLine().trim() br.readLine().trim br.readLine() br.readLine br " " Integer[] intarray = new Integer[strarray.length]; intarray new Integer[strarray.length] strarray.length strarray strarray.length for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        } int i = 0; int i = 0; i 0 i < intarray.length i intarray.length intarray intarray.length i++ i++ i {
            intarray[i] = Integer.parseInt(strarray[i]);
        } {
            intarray[i] = Integer.parseInt(strarray[i]);
        } intarray[i] = Integer.parseInt(strarray[i]) intarray[i] intarray i Integer.parseInt(strarray[i]) Integer.parseInt Integer strarray[i] strarray i return intarray; intarray public static void main(String[] args) throws Exception {
        // write your code here
        int [] c1 = inputval();
        int [] c2 = inputval();
        int [] c3 = inputval();
        int c1Sum = Arrays.stream(c1).sum();
        int c2Sum = Arrays.stream(c2).sum();
        int c3Sum = Arrays.stream(c3).sum();
        int b1row = c1[0] + c2[0] + c3[0];
        int b2row = c1[1] + c2[1] + c3[1];
        int b3row = c1[2] + c2[2] + c3[2];

        boolean isAcorrect = Math.abs(c2Sum-c1Sum) %3 == 0 && Math.abs(c3Sum-c1Sum) %3 == 0 && Math.abs(c3Sum-c2Sum) %3 == 0;
        boolean isBcorrect = Math.abs(b2row-b1row) %3 == 0 && Math.abs(b3row-b1row) %3 == 0 && Math.abs(b3row-b2row) %3 == 0;
        if (isAcorrect && isBcorrect){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }

    } main {
        // write your code here
        int [] c1 = inputval();
        int [] c2 = inputval();
        int [] c3 = inputval();
        int c1Sum = Arrays.stream(c1).sum();
        int c2Sum = Arrays.stream(c2).sum();
        int c3Sum = Arrays.stream(c3).sum();
        int b1row = c1[0] + c2[0] + c3[0];
        int b2row = c1[1] + c2[1] + c3[1];
        int b3row = c1[2] + c2[2] + c3[2];

        boolean isAcorrect = Math.abs(c2Sum-c1Sum) %3 == 0 && Math.abs(c3Sum-c1Sum) %3 == 0 && Math.abs(c3Sum-c2Sum) %3 == 0;
        boolean isBcorrect = Math.abs(b2row-b1row) %3 == 0 && Math.abs(b3row-b1row) %3 == 0 && Math.abs(b3row-b2row) %3 == 0;
        if (isAcorrect && isBcorrect){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }

    } int [] c1 = inputval(); c1 inputval() inputval int [] c2 = inputval(); c2 inputval() inputval int [] c3 = inputval(); c3 inputval() inputval int c1Sum = Arrays.stream(c1).sum(); c1Sum Arrays.stream(c1).sum() Arrays.stream(c1).sum Arrays.stream(c1) Arrays.stream Arrays c1 int c2Sum = Arrays.stream(c2).sum(); c2Sum Arrays.stream(c2).sum() Arrays.stream(c2).sum Arrays.stream(c2) Arrays.stream Arrays c2 int c3Sum = Arrays.stream(c3).sum(); c3Sum Arrays.stream(c3).sum() Arrays.stream(c3).sum Arrays.stream(c3) Arrays.stream Arrays c3 int b1row = c1[0] + c2[0] + c3[0]; b1row c1[0] + c2[0] + c3[0] c1[0] + c2[0] + c3[0] c1[0] c1 0 c2[0] c2 0 c3[0] c3 0 int b2row = c1[1] + c2[1] + c3[1]; b2row c1[1] + c2[1] + c3[1] c1[1] + c2[1] + c3[1] c1[1] c1 1 c2[1] c2 1 c3[1] c3 1 int b3row = c1[2] + c2[2] + c3[2]; b3row c1[2] + c2[2] + c3[2] c1[2] + c2[2] + c3[2] c1[2] c1 2 c2[2] c2 2 c3[2] c3 2 boolean isAcorrect = Math.abs(c2Sum-c1Sum) %3 == 0 && Math.abs(c3Sum-c1Sum) %3 == 0 && Math.abs(c3Sum-c2Sum) %3 == 0; isAcorrect Math.abs(c2Sum-c1Sum) %3 == 0 && Math.abs(c3Sum-c1Sum) %3 == 0 && Math.abs(c3Sum-c2Sum) %3 == 0 Math.abs(c2Sum-c1Sum) %3 == 0 && Math.abs(c3Sum-c1Sum) %3 == 0 && Math.abs(c3Sum-c2Sum) %3 == 0 Math.abs(c2Sum-c1Sum) %3 == 0 Math.abs(c2Sum-c1Sum) %3 Math.abs(c2Sum-c1Sum) Math.abs Math c2Sum-c1Sum c2Sum c1Sum 3 0 Math.abs(c3Sum-c1Sum) %3 == 0 Math.abs(c3Sum-c1Sum) %3 Math.abs(c3Sum-c1Sum) Math.abs Math c3Sum-c1Sum c3Sum c1Sum 3 0 Math.abs(c3Sum-c2Sum) %3 == 0 Math.abs(c3Sum-c2Sum) %3 Math.abs(c3Sum-c2Sum) Math.abs Math c3Sum-c2Sum c3Sum c2Sum 3 0 boolean isBcorrect = Math.abs(b2row-b1row) %3 == 0 && Math.abs(b3row-b1row) %3 == 0 && Math.abs(b3row-b2row) %3 == 0; isBcorrect Math.abs(b2row-b1row) %3 == 0 && Math.abs(b3row-b1row) %3 == 0 && Math.abs(b3row-b2row) %3 == 0 Math.abs(b2row-b1row) %3 == 0 && Math.abs(b3row-b1row) %3 == 0 && Math.abs(b3row-b2row) %3 == 0 Math.abs(b2row-b1row) %3 == 0 Math.abs(b2row-b1row) %3 Math.abs(b2row-b1row) Math.abs Math b2row-b1row b2row b1row 3 0 Math.abs(b3row-b1row) %3 == 0 Math.abs(b3row-b1row) %3 Math.abs(b3row-b1row) Math.abs Math b3row-b1row b3row b1row 3 0 Math.abs(b3row-b2row) %3 == 0 Math.abs(b3row-b2row) %3 Math.abs(b3row-b2row) Math.abs Math b3row-b2row b3row b2row 3 0 if (isAcorrect && isBcorrect){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        } isAcorrect && isBcorrect isAcorrect isBcorrect {
            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 {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用 int
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    // 標準入力数値リスト用 int
    static List<Integer> inputIntList() throws Exception {
        List<String> strList = Arrays.asList(br.readLine().trim().split(" "));
        List<Integer> intList = new ArrayList<Integer>();
        for (String elem : strList){
            intList.add(Integer.parseInt(elem));
        }
        return intList;
    }

    // 標準入力数値配列用 integer 降順ソート用
    static Integer[] inputvalInteger() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    public static void main(String[] args) throws Exception {
        // write your code here
        int [] c1 = inputval();
        int [] c2 = inputval();
        int [] c3 = inputval();
        int c1Sum = Arrays.stream(c1).sum();
        int c2Sum = Arrays.stream(c2).sum();
        int c3Sum = Arrays.stream(c3).sum();
        int b1row = c1[0] + c2[0] + c3[0];
        int b2row = c1[1] + c2[1] + c3[1];
        int b3row = c1[2] + c2[2] + c3[2];

        boolean isAcorrect = Math.abs(c2Sum-c1Sum) %3 == 0 && Math.abs(c3Sum-c1Sum) %3 == 0 && Math.abs(c3Sum-c2Sum) %3 == 0;
        boolean isBcorrect = Math.abs(b2row-b1row) %3 == 0 && Math.abs(b3row-b1row) %3 == 0 && Math.abs(b3row-b2row) %3 == 0;
        if (isAcorrect && isBcorrect){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }

    }

} public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用 int
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    // 標準入力数値リスト用 int
    static List<Integer> inputIntList() throws Exception {
        List<String> strList = Arrays.asList(br.readLine().trim().split(" "));
        List<Integer> intList = new ArrayList<Integer>();
        for (String elem : strList){
            intList.add(Integer.parseInt(elem));
        }
        return intList;
    }

    // 標準入力数値配列用 integer 降順ソート用
    static Integer[] inputvalInteger() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    public static void main(String[] args) throws Exception {
        // write your code here
        int [] c1 = inputval();
        int [] c2 = inputval();
        int [] c3 = inputval();
        int c1Sum = Arrays.stream(c1).sum();
        int c2Sum = Arrays.stream(c2).sum();
        int c3Sum = Arrays.stream(c3).sum();
        int b1row = c1[0] + c2[0] + c3[0];
        int b2row = c1[1] + c2[1] + c3[1];
        int b3row = c1[2] + c2[2] + c3[2];

        boolean isAcorrect = Math.abs(c2Sum-c1Sum) %3 == 0 && Math.abs(c3Sum-c1Sum) %3 == 0 && Math.abs(c3Sum-c2Sum) %3 == 0;
        boolean isBcorrect = Math.abs(b2row-b1row) %3 == 0 && Math.abs(b3row-b1row) %3 == 0 && Math.abs(b3row-b2row) %3 == 0;
        if (isAcorrect && isBcorrect){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }

    }

} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;

import java.util.Arrays;
import java.util.Collections;
import java.util.ArrayList;
import java.util.List;
import java.util.HashSet;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.util.Comparator;
import java.util.Set;
import java.util.HashMap;
import java.util.Map;

public class Main {
    // 標準入力
    static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

    // 標準入力数値配列用 int
    static int[] inputval() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        int[] intarray = new int[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    // 標準入力数値リスト用 int
    static List<Integer> inputIntList() throws Exception {
        List<String> strList = Arrays.asList(br.readLine().trim().split(" "));
        List<Integer> intList = new ArrayList<Integer>();
        for (String elem : strList){
            intList.add(Integer.parseInt(elem));
        }
        return intList;
    }

    // 標準入力数値配列用 integer 降順ソート用
    static Integer[] inputvalInteger() throws Exception {
        String[] strarray = br.readLine().trim().split(" ");
        Integer[] intarray = new Integer[strarray.length];
        for (int i = 0; i < intarray.length; i++) {
            intarray[i] = Integer.parseInt(strarray[i]);
        }
        return intarray;
    }

    public static void main(String[] args) throws Exception {
        // write your code here
        int [] c1 = inputval();
        int [] c2 = inputval();
        int [] c3 = inputval();
        int c1Sum = Arrays.stream(c1).sum();
        int c2Sum = Arrays.stream(c2).sum();
        int c3Sum = Arrays.stream(c3).sum();
        int b1row = c1[0] + c2[0] + c3[0];
        int b2row = c1[1] + c2[1] + c3[1];
        int b3row = c1[2] + c2[2] + c3[2];

        boolean isAcorrect = Math.abs(c2Sum-c1Sum) %3 == 0 && Math.abs(c3Sum-c1Sum) %3 == 0 && Math.abs(c3Sum-c2Sum) %3 == 0;
        boolean isBcorrect = Math.abs(b2row-b1row) %3 == 0 && Math.abs(b3row-b1row) %3 == 0 && Math.abs(b3row-b2row) %3 == 0;
        if (isAcorrect && isBcorrect){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }

    }

}

