import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collections;

public class Main {
  /**
   * main method.
   */
  public static void main(String[] args) throws IOException {
    InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
    BufferedReader in = new BufferedReader(reader);
    
    //グリッド
    int[][] grid = new int[3][3];
    for (int i = 0; i < 3; i++) {
    	String line = in.readLine();
    	for (int j = 0; j < 3; j++) {
    		String[] line_char = line.split(" ");
    		grid[i][j] = Integer.parseInt(line_char[j]);	
        }
    }
    
    //正しい場合はtrue
    boolean trueFlag = true;
    
    for (int i = 1; i < 3; i++) {
    	for (int j = 0; j < 2; j++) {
    		if (grid[i][j] - grid[i-1][j] != grid[i][j+1] - grid[i-1][j+1]) {
    			trueFlag = false;
    		}
        }
    }
    
    if (trueFlag) {
    	System.out.println("Yes");
    } else {
    	System.out.println("No");
    }
    
  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io import java.nio.charset.StandardCharsets; StandardCharsets java.nio.charset import java.util.Arrays; Arrays java.util import java.util.Collections; Collections java.util public class Main {
  /**
   * main method.
   */
  public static void main(String[] args) throws IOException {
    InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
    BufferedReader in = new BufferedReader(reader);
    
    //グリッド
    int[][] grid = new int[3][3];
    for (int i = 0; i < 3; i++) {
    	String line = in.readLine();
    	for (int j = 0; j < 3; j++) {
    		String[] line_char = line.split(" ");
    		grid[i][j] = Integer.parseInt(line_char[j]);	
        }
    }
    
    //正しい場合はtrue
    boolean trueFlag = true;
    
    for (int i = 1; i < 3; i++) {
    	for (int j = 0; j < 2; j++) {
    		if (grid[i][j] - grid[i-1][j] != grid[i][j+1] - grid[i-1][j+1]) {
    			trueFlag = false;
    		}
        }
    }
    
    if (trueFlag) {
    	System.out.println("Yes");
    } else {
    	System.out.println("No");
    }
    
  }
} Main /**
   * main method.
   */
  public static void main(String[] args) throws IOException {
    InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
    BufferedReader in = new BufferedReader(reader);
    
    //グリッド
    int[][] grid = new int[3][3];
    for (int i = 0; i < 3; i++) {
    	String line = in.readLine();
    	for (int j = 0; j < 3; j++) {
    		String[] line_char = line.split(" ");
    		grid[i][j] = Integer.parseInt(line_char[j]);	
        }
    }
    
    //正しい場合はtrue
    boolean trueFlag = true;
    
    for (int i = 1; i < 3; i++) {
    	for (int j = 0; j < 2; j++) {
    		if (grid[i][j] - grid[i-1][j] != grid[i][j+1] - grid[i-1][j+1]) {
    			trueFlag = false;
    		}
        }
    }
    
    if (trueFlag) {
    	System.out.println("Yes");
    } else {
    	System.out.println("No");
    }
    
  } main {
    InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
    BufferedReader in = new BufferedReader(reader);
    
    //グリッド
    int[][] grid = new int[3][3];
    for (int i = 0; i < 3; i++) {
    	String line = in.readLine();
    	for (int j = 0; j < 3; j++) {
    		String[] line_char = line.split(" ");
    		grid[i][j] = Integer.parseInt(line_char[j]);	
        }
    }
    
    //正しい場合はtrue
    boolean trueFlag = true;
    
    for (int i = 1; i < 3; i++) {
    	for (int j = 0; j < 2; j++) {
    		if (grid[i][j] - grid[i-1][j] != grid[i][j+1] - grid[i-1][j+1]) {
    			trueFlag = false;
    		}
        }
    }
    
    if (trueFlag) {
    	System.out.println("Yes");
    } else {
    	System.out.println("No");
    }
    
  } InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8); reader new InputStreamReader(System.in, StandardCharsets.UTF_8) BufferedReader in = new BufferedReader(reader); in new BufferedReader(reader) int[][] grid = new int[3][3]; grid new int[3][3] 3 3 for (int i = 0; i < 3; i++) {
    	String line = in.readLine();
    	for (int j = 0; j < 3; j++) {
    		String[] line_char = line.split(" ");
    		grid[i][j] = Integer.parseInt(line_char[j]);	
        }
    } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
    	String line = in.readLine();
    	for (int j = 0; j < 3; j++) {
    		String[] line_char = line.split(" ");
    		grid[i][j] = Integer.parseInt(line_char[j]);	
        }
    } {
    	String line = in.readLine();
    	for (int j = 0; j < 3; j++) {
    		String[] line_char = line.split(" ");
    		grid[i][j] = Integer.parseInt(line_char[j]);	
        }
    } String line = in.readLine(); line in.readLine() in.readLine in for (int j = 0; j < 3; j++) {
    		String[] line_char = line.split(" ");
    		grid[i][j] = Integer.parseInt(line_char[j]);	
        } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
    		String[] line_char = line.split(" ");
    		grid[i][j] = Integer.parseInt(line_char[j]);	
        } {
    		String[] line_char = line.split(" ");
    		grid[i][j] = Integer.parseInt(line_char[j]);	
        } String[] line_char = line.split(" "); line_char line.split(" ") line.split line " " grid[i][j] = Integer.parseInt(line_char[j]) grid[i][j] grid[i] grid i j Integer.parseInt(line_char[j]) Integer.parseInt Integer line_char[j] line_char j boolean trueFlag = true; trueFlag true for (int i = 1; i < 3; i++) {
    	for (int j = 0; j < 2; j++) {
    		if (grid[i][j] - grid[i-1][j] != grid[i][j+1] - grid[i-1][j+1]) {
    			trueFlag = false;
    		}
        }
    } int i = 1; int i = 1; i 1 i < 3 i 3 i++ i++ i {
    	for (int j = 0; j < 2; j++) {
    		if (grid[i][j] - grid[i-1][j] != grid[i][j+1] - grid[i-1][j+1]) {
    			trueFlag = false;
    		}
        }
    } {
    	for (int j = 0; j < 2; j++) {
    		if (grid[i][j] - grid[i-1][j] != grid[i][j+1] - grid[i-1][j+1]) {
    			trueFlag = false;
    		}
        }
    } for (int j = 0; j < 2; j++) {
    		if (grid[i][j] - grid[i-1][j] != grid[i][j+1] - grid[i-1][j+1]) {
    			trueFlag = false;
    		}
        } int j = 0; int j = 0; j 0 j < 2 j 2 j++ j++ j {
    		if (grid[i][j] - grid[i-1][j] != grid[i][j+1] - grid[i-1][j+1]) {
    			trueFlag = false;
    		}
        } {
    		if (grid[i][j] - grid[i-1][j] != grid[i][j+1] - grid[i-1][j+1]) {
    			trueFlag = false;
    		}
        } if (grid[i][j] - grid[i-1][j] != grid[i][j+1] - grid[i-1][j+1]) {
    			trueFlag = false;
    		} grid[i][j] - grid[i-1][j] != grid[i][j+1] - grid[i-1][j+1] grid[i][j] - grid[i-1][j] grid[i][j] grid[i] grid i j grid[i-1][j] grid[i-1] grid i-1 i 1 j grid[i][j+1] - grid[i-1][j+1] grid[i][j+1] grid[i] grid i j+1 j 1 grid[i-1][j+1] grid[i-1] grid i-1 i 1 j+1 j 1 {
    			trueFlag = false;
    		} trueFlag = false trueFlag false if (trueFlag) {
    	System.out.println("Yes");
    } else {
    	System.out.println("No");
    } trueFlag {
    	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 {
  /**
   * main method.
   */
  public static void main(String[] args) throws IOException {
    InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
    BufferedReader in = new BufferedReader(reader);
    
    //グリッド
    int[][] grid = new int[3][3];
    for (int i = 0; i < 3; i++) {
    	String line = in.readLine();
    	for (int j = 0; j < 3; j++) {
    		String[] line_char = line.split(" ");
    		grid[i][j] = Integer.parseInt(line_char[j]);	
        }
    }
    
    //正しい場合はtrue
    boolean trueFlag = true;
    
    for (int i = 1; i < 3; i++) {
    	for (int j = 0; j < 2; j++) {
    		if (grid[i][j] - grid[i-1][j] != grid[i][j+1] - grid[i-1][j+1]) {
    			trueFlag = false;
    		}
        }
    }
    
    if (trueFlag) {
    	System.out.println("Yes");
    } else {
    	System.out.println("No");
    }
    
  }
} public class Main {
  /**
   * main method.
   */
  public static void main(String[] args) throws IOException {
    InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
    BufferedReader in = new BufferedReader(reader);
    
    //グリッド
    int[][] grid = new int[3][3];
    for (int i = 0; i < 3; i++) {
    	String line = in.readLine();
    	for (int j = 0; j < 3; j++) {
    		String[] line_char = line.split(" ");
    		grid[i][j] = Integer.parseInt(line_char[j]);	
        }
    }
    
    //正しい場合はtrue
    boolean trueFlag = true;
    
    for (int i = 1; i < 3; i++) {
    	for (int j = 0; j < 2; j++) {
    		if (grid[i][j] - grid[i-1][j] != grid[i][j+1] - grid[i-1][j+1]) {
    			trueFlag = false;
    		}
        }
    }
    
    if (trueFlag) {
    	System.out.println("Yes");
    } else {
    	System.out.println("No");
    }
    
  }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collections;

public class Main {
  /**
   * main method.
   */
  public static void main(String[] args) throws IOException {
    InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
    BufferedReader in = new BufferedReader(reader);
    
    //グリッド
    int[][] grid = new int[3][3];
    for (int i = 0; i < 3; i++) {
    	String line = in.readLine();
    	for (int j = 0; j < 3; j++) {
    		String[] line_char = line.split(" ");
    		grid[i][j] = Integer.parseInt(line_char[j]);	
        }
    }
    
    //正しい場合はtrue
    boolean trueFlag = true;
    
    for (int i = 1; i < 3; i++) {
    	for (int j = 0; j < 2; j++) {
    		if (grid[i][j] - grid[i-1][j] != grid[i][j+1] - grid[i-1][j+1]) {
    			trueFlag = false;
    		}
        }
    }
    
    if (trueFlag) {
    	System.out.println("Yes");
    } else {
    	System.out.println("No");
    }
    
  }
}