import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int[][] grid = new int[3][3];
      	for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                grid[i][j] = sc.nextInt();
            }
        }

        for(int a1 = 0; a1 <= Math.min(grid[0][0], Math.min(grid[0][1], grid[0][2])); a1++){
            for(int a2 = 0; a2 <= Math.min(grid[1][0], Math.min(grid[1][1], grid[1][2])); a2++){
                for(int a3 = 0; a3 <= Math.min(grid[2][0], Math.min(grid[2][1], grid[2][2])); a3++){
                    if((grid[0][0] - a1 != grid[1][0] - a2) || (grid[1][0] - a2 != grid[2][0] - a3)){
                        continue;
                    }
                    if((grid[0][1] - a1 != grid[1][1] - a2) || (grid[1][1] - a2 != grid[2][1] - a3)){
                        continue;
                    }
                    if((grid[0][2] - a1 != grid[1][2] - a2) || (grid[1][2] - a2 != grid[2][2] - a3)){
                        continue;
                    }
                    System.out.println("Yes");
                    return;
                }
            }
        }

        System.out.println("No");
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int[][] grid = new int[3][3];
      	for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                grid[i][j] = sc.nextInt();
            }
        }

        for(int a1 = 0; a1 <= Math.min(grid[0][0], Math.min(grid[0][1], grid[0][2])); a1++){
            for(int a2 = 0; a2 <= Math.min(grid[1][0], Math.min(grid[1][1], grid[1][2])); a2++){
                for(int a3 = 0; a3 <= Math.min(grid[2][0], Math.min(grid[2][1], grid[2][2])); a3++){
                    if((grid[0][0] - a1 != grid[1][0] - a2) || (grid[1][0] - a2 != grid[2][0] - a3)){
                        continue;
                    }
                    if((grid[0][1] - a1 != grid[1][1] - a2) || (grid[1][1] - a2 != grid[2][1] - a3)){
                        continue;
                    }
                    if((grid[0][2] - a1 != grid[1][2] - a2) || (grid[1][2] - a2 != grid[2][2] - a3)){
                        continue;
                    }
                    System.out.println("Yes");
                    return;
                }
            }
        }

        System.out.println("No");
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int[][] grid = new int[3][3];
      	for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                grid[i][j] = sc.nextInt();
            }
        }

        for(int a1 = 0; a1 <= Math.min(grid[0][0], Math.min(grid[0][1], grid[0][2])); a1++){
            for(int a2 = 0; a2 <= Math.min(grid[1][0], Math.min(grid[1][1], grid[1][2])); a2++){
                for(int a3 = 0; a3 <= Math.min(grid[2][0], Math.min(grid[2][1], grid[2][2])); a3++){
                    if((grid[0][0] - a1 != grid[1][0] - a2) || (grid[1][0] - a2 != grid[2][0] - a3)){
                        continue;
                    }
                    if((grid[0][1] - a1 != grid[1][1] - a2) || (grid[1][1] - a2 != grid[2][1] - a3)){
                        continue;
                    }
                    if((grid[0][2] - a1 != grid[1][2] - a2) || (grid[1][2] - a2 != grid[2][2] - a3)){
                        continue;
                    }
                    System.out.println("Yes");
                    return;
                }
            }
        }

        System.out.println("No");
	} main {
		Scanner sc = new Scanner(System.in);
        int[][] grid = new int[3][3];
      	for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                grid[i][j] = sc.nextInt();
            }
        }

        for(int a1 = 0; a1 <= Math.min(grid[0][0], Math.min(grid[0][1], grid[0][2])); a1++){
            for(int a2 = 0; a2 <= Math.min(grid[1][0], Math.min(grid[1][1], grid[1][2])); a2++){
                for(int a3 = 0; a3 <= Math.min(grid[2][0], Math.min(grid[2][1], grid[2][2])); a3++){
                    if((grid[0][0] - a1 != grid[1][0] - a2) || (grid[1][0] - a2 != grid[2][0] - a3)){
                        continue;
                    }
                    if((grid[0][1] - a1 != grid[1][1] - a2) || (grid[1][1] - a2 != grid[2][1] - a3)){
                        continue;
                    }
                    if((grid[0][2] - a1 != grid[1][2] - a2) || (grid[1][2] - a2 != grid[2][2] - a3)){
                        continue;
                    }
                    System.out.println("Yes");
                    return;
                }
            }
        }

        System.out.println("No");
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] grid = new int[3][3]; grid new int[3][3] 3 3 for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                grid[i][j] = sc.nextInt();
            }
        } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
            for(int j = 0; j < 3; j++){
                grid[i][j] = sc.nextInt();
            }
        } {
            for(int j = 0; j < 3; j++){
                grid[i][j] = sc.nextInt();
            }
        } for(int j = 0; j < 3; j++){
                grid[i][j] = sc.nextInt();
            } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
                grid[i][j] = sc.nextInt();
            } {
                grid[i][j] = sc.nextInt();
            } grid[i][j] = sc.nextInt() grid[i][j] grid[i] grid i j sc.nextInt() sc.nextInt sc for(int a1 = 0; a1 <= Math.min(grid[0][0], Math.min(grid[0][1], grid[0][2])); a1++){
            for(int a2 = 0; a2 <= Math.min(grid[1][0], Math.min(grid[1][1], grid[1][2])); a2++){
                for(int a3 = 0; a3 <= Math.min(grid[2][0], Math.min(grid[2][1], grid[2][2])); a3++){
                    if((grid[0][0] - a1 != grid[1][0] - a2) || (grid[1][0] - a2 != grid[2][0] - a3)){
                        continue;
                    }
                    if((grid[0][1] - a1 != grid[1][1] - a2) || (grid[1][1] - a2 != grid[2][1] - a3)){
                        continue;
                    }
                    if((grid[0][2] - a1 != grid[1][2] - a2) || (grid[1][2] - a2 != grid[2][2] - a3)){
                        continue;
                    }
                    System.out.println("Yes");
                    return;
                }
            }
        } int a1 = 0; int a1 = 0; a1 0 a1 <= Math.min(grid[0][0], Math.min(grid[0][1], grid[0][2])) a1 Math.min(grid[0][0], Math.min(grid[0][1], grid[0][2])) Math.min Math grid[0][0] grid[0] grid 0 0 Math.min(grid[0][1], grid[0][2]) Math.min Math grid[0][1] grid[0] grid 0 1 grid[0][2] grid[0] grid 0 2 a1++ a1++ a1 {
            for(int a2 = 0; a2 <= Math.min(grid[1][0], Math.min(grid[1][1], grid[1][2])); a2++){
                for(int a3 = 0; a3 <= Math.min(grid[2][0], Math.min(grid[2][1], grid[2][2])); a3++){
                    if((grid[0][0] - a1 != grid[1][0] - a2) || (grid[1][0] - a2 != grid[2][0] - a3)){
                        continue;
                    }
                    if((grid[0][1] - a1 != grid[1][1] - a2) || (grid[1][1] - a2 != grid[2][1] - a3)){
                        continue;
                    }
                    if((grid[0][2] - a1 != grid[1][2] - a2) || (grid[1][2] - a2 != grid[2][2] - a3)){
                        continue;
                    }
                    System.out.println("Yes");
                    return;
                }
            }
        } {
            for(int a2 = 0; a2 <= Math.min(grid[1][0], Math.min(grid[1][1], grid[1][2])); a2++){
                for(int a3 = 0; a3 <= Math.min(grid[2][0], Math.min(grid[2][1], grid[2][2])); a3++){
                    if((grid[0][0] - a1 != grid[1][0] - a2) || (grid[1][0] - a2 != grid[2][0] - a3)){
                        continue;
                    }
                    if((grid[0][1] - a1 != grid[1][1] - a2) || (grid[1][1] - a2 != grid[2][1] - a3)){
                        continue;
                    }
                    if((grid[0][2] - a1 != grid[1][2] - a2) || (grid[1][2] - a2 != grid[2][2] - a3)){
                        continue;
                    }
                    System.out.println("Yes");
                    return;
                }
            }
        } for(int a2 = 0; a2 <= Math.min(grid[1][0], Math.min(grid[1][1], grid[1][2])); a2++){
                for(int a3 = 0; a3 <= Math.min(grid[2][0], Math.min(grid[2][1], grid[2][2])); a3++){
                    if((grid[0][0] - a1 != grid[1][0] - a2) || (grid[1][0] - a2 != grid[2][0] - a3)){
                        continue;
                    }
                    if((grid[0][1] - a1 != grid[1][1] - a2) || (grid[1][1] - a2 != grid[2][1] - a3)){
                        continue;
                    }
                    if((grid[0][2] - a1 != grid[1][2] - a2) || (grid[1][2] - a2 != grid[2][2] - a3)){
                        continue;
                    }
                    System.out.println("Yes");
                    return;
                }
            } int a2 = 0; int a2 = 0; a2 0 a2 <= Math.min(grid[1][0], Math.min(grid[1][1], grid[1][2])) a2 Math.min(grid[1][0], Math.min(grid[1][1], grid[1][2])) Math.min Math grid[1][0] grid[1] grid 1 0 Math.min(grid[1][1], grid[1][2]) Math.min Math grid[1][1] grid[1] grid 1 1 grid[1][2] grid[1] grid 1 2 a2++ a2++ a2 {
                for(int a3 = 0; a3 <= Math.min(grid[2][0], Math.min(grid[2][1], grid[2][2])); a3++){
                    if((grid[0][0] - a1 != grid[1][0] - a2) || (grid[1][0] - a2 != grid[2][0] - a3)){
                        continue;
                    }
                    if((grid[0][1] - a1 != grid[1][1] - a2) || (grid[1][1] - a2 != grid[2][1] - a3)){
                        continue;
                    }
                    if((grid[0][2] - a1 != grid[1][2] - a2) || (grid[1][2] - a2 != grid[2][2] - a3)){
                        continue;
                    }
                    System.out.println("Yes");
                    return;
                }
            } {
                for(int a3 = 0; a3 <= Math.min(grid[2][0], Math.min(grid[2][1], grid[2][2])); a3++){
                    if((grid[0][0] - a1 != grid[1][0] - a2) || (grid[1][0] - a2 != grid[2][0] - a3)){
                        continue;
                    }
                    if((grid[0][1] - a1 != grid[1][1] - a2) || (grid[1][1] - a2 != grid[2][1] - a3)){
                        continue;
                    }
                    if((grid[0][2] - a1 != grid[1][2] - a2) || (grid[1][2] - a2 != grid[2][2] - a3)){
                        continue;
                    }
                    System.out.println("Yes");
                    return;
                }
            } for(int a3 = 0; a3 <= Math.min(grid[2][0], Math.min(grid[2][1], grid[2][2])); a3++){
                    if((grid[0][0] - a1 != grid[1][0] - a2) || (grid[1][0] - a2 != grid[2][0] - a3)){
                        continue;
                    }
                    if((grid[0][1] - a1 != grid[1][1] - a2) || (grid[1][1] - a2 != grid[2][1] - a3)){
                        continue;
                    }
                    if((grid[0][2] - a1 != grid[1][2] - a2) || (grid[1][2] - a2 != grid[2][2] - a3)){
                        continue;
                    }
                    System.out.println("Yes");
                    return;
                } int a3 = 0; int a3 = 0; a3 0 a3 <= Math.min(grid[2][0], Math.min(grid[2][1], grid[2][2])) a3 Math.min(grid[2][0], Math.min(grid[2][1], grid[2][2])) Math.min Math grid[2][0] grid[2] grid 2 0 Math.min(grid[2][1], grid[2][2]) Math.min Math grid[2][1] grid[2] grid 2 1 grid[2][2] grid[2] grid 2 2 a3++ a3++ a3 {
                    if((grid[0][0] - a1 != grid[1][0] - a2) || (grid[1][0] - a2 != grid[2][0] - a3)){
                        continue;
                    }
                    if((grid[0][1] - a1 != grid[1][1] - a2) || (grid[1][1] - a2 != grid[2][1] - a3)){
                        continue;
                    }
                    if((grid[0][2] - a1 != grid[1][2] - a2) || (grid[1][2] - a2 != grid[2][2] - a3)){
                        continue;
                    }
                    System.out.println("Yes");
                    return;
                } {
                    if((grid[0][0] - a1 != grid[1][0] - a2) || (grid[1][0] - a2 != grid[2][0] - a3)){
                        continue;
                    }
                    if((grid[0][1] - a1 != grid[1][1] - a2) || (grid[1][1] - a2 != grid[2][1] - a3)){
                        continue;
                    }
                    if((grid[0][2] - a1 != grid[1][2] - a2) || (grid[1][2] - a2 != grid[2][2] - a3)){
                        continue;
                    }
                    System.out.println("Yes");
                    return;
                } if((grid[0][0] - a1 != grid[1][0] - a2) || (grid[1][0] - a2 != grid[2][0] - a3)){
                        continue;
                    } (grid[0][0] - a1 != grid[1][0] - a2) || (grid[1][0] - a2 != grid[2][0] - a3) (grid[0][0] - a1 != grid[1][0] - a2) grid[0][0] - a1 grid[0][0] grid[0] grid 0 0 a1 grid[1][0] - a2 grid[1][0] grid[1] grid 1 0 a2 (grid[1][0] - a2 != grid[2][0] - a3) grid[1][0] - a2 grid[1][0] grid[1] grid 1 0 a2 grid[2][0] - a3 grid[2][0] grid[2] grid 2 0 a3 {
                        continue;
                    } continue; if((grid[0][1] - a1 != grid[1][1] - a2) || (grid[1][1] - a2 != grid[2][1] - a3)){
                        continue;
                    } (grid[0][1] - a1 != grid[1][1] - a2) || (grid[1][1] - a2 != grid[2][1] - a3) (grid[0][1] - a1 != grid[1][1] - a2) grid[0][1] - a1 grid[0][1] grid[0] grid 0 1 a1 grid[1][1] - a2 grid[1][1] grid[1] grid 1 1 a2 (grid[1][1] - a2 != grid[2][1] - a3) grid[1][1] - a2 grid[1][1] grid[1] grid 1 1 a2 grid[2][1] - a3 grid[2][1] grid[2] grid 2 1 a3 {
                        continue;
                    } continue; if((grid[0][2] - a1 != grid[1][2] - a2) || (grid[1][2] - a2 != grid[2][2] - a3)){
                        continue;
                    } (grid[0][2] - a1 != grid[1][2] - a2) || (grid[1][2] - a2 != grid[2][2] - a3) (grid[0][2] - a1 != grid[1][2] - a2) grid[0][2] - a1 grid[0][2] grid[0] grid 0 2 a1 grid[1][2] - a2 grid[1][2] grid[1] grid 1 2 a2 (grid[1][2] - a2 != grid[2][2] - a3) grid[1][2] - a2 grid[1][2] grid[1] grid 1 2 a2 grid[2][2] - a3 grid[2][2] grid[2] grid 2 2 a3 {
                        continue;
                    } continue; System.out.println("Yes") System.out.println System.out System System.out "Yes" return; 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[][] grid = new int[3][3];
      	for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                grid[i][j] = sc.nextInt();
            }
        }

        for(int a1 = 0; a1 <= Math.min(grid[0][0], Math.min(grid[0][1], grid[0][2])); a1++){
            for(int a2 = 0; a2 <= Math.min(grid[1][0], Math.min(grid[1][1], grid[1][2])); a2++){
                for(int a3 = 0; a3 <= Math.min(grid[2][0], Math.min(grid[2][1], grid[2][2])); a3++){
                    if((grid[0][0] - a1 != grid[1][0] - a2) || (grid[1][0] - a2 != grid[2][0] - a3)){
                        continue;
                    }
                    if((grid[0][1] - a1 != grid[1][1] - a2) || (grid[1][1] - a2 != grid[2][1] - a3)){
                        continue;
                    }
                    if((grid[0][2] - a1 != grid[1][2] - a2) || (grid[1][2] - a2 != grid[2][2] - a3)){
                        continue;
                    }
                    System.out.println("Yes");
                    return;
                }
            }
        }

        System.out.println("No");
	}
} public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int[][] grid = new int[3][3];
      	for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                grid[i][j] = sc.nextInt();
            }
        }

        for(int a1 = 0; a1 <= Math.min(grid[0][0], Math.min(grid[0][1], grid[0][2])); a1++){
            for(int a2 = 0; a2 <= Math.min(grid[1][0], Math.min(grid[1][1], grid[1][2])); a2++){
                for(int a3 = 0; a3 <= Math.min(grid[2][0], Math.min(grid[2][1], grid[2][2])); a3++){
                    if((grid[0][0] - a1 != grid[1][0] - a2) || (grid[1][0] - a2 != grid[2][0] - a3)){
                        continue;
                    }
                    if((grid[0][1] - a1 != grid[1][1] - a2) || (grid[1][1] - a2 != grid[2][1] - a3)){
                        continue;
                    }
                    if((grid[0][2] - a1 != grid[1][2] - a2) || (grid[1][2] - a2 != grid[2][2] - a3)){
                        continue;
                    }
                    System.out.println("Yes");
                    return;
                }
            }
        }

        System.out.println("No");
	}
} Main
import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int[][] grid = new int[3][3];
      	for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                grid[i][j] = sc.nextInt();
            }
        }

        for(int a1 = 0; a1 <= Math.min(grid[0][0], Math.min(grid[0][1], grid[0][2])); a1++){
            for(int a2 = 0; a2 <= Math.min(grid[1][0], Math.min(grid[1][1], grid[1][2])); a2++){
                for(int a3 = 0; a3 <= Math.min(grid[2][0], Math.min(grid[2][1], grid[2][2])); a3++){
                    if((grid[0][0] - a1 != grid[1][0] - a2) || (grid[1][0] - a2 != grid[2][0] - a3)){
                        continue;
                    }
                    if((grid[0][1] - a1 != grid[1][1] - a2) || (grid[1][1] - a2 != grid[2][1] - a3)){
                        continue;
                    }
                    if((grid[0][2] - a1 != grid[1][2] - a2) || (grid[1][2] - a2 != grid[2][2] - a3)){
                        continue;
                    }
                    System.out.println("Yes");
                    return;
                }
            }
        }

        System.out.println("No");
	}
}