import java.util.*;


public  class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] values = new int[3][3];
        for (int y = 0; y < 3; y++) {
        	for (int x = 0; x < 3; x++) {
        		values[y][x] = sc.nextInt();
        	}
        }
        
        int[] a_values = new int[3];
        int[] b_values = new int[3];
        a_values[0] = 0;
        for (int x = 0; x < 3; x++) {
        	b_values[x] = values[0][x];
        }
        for (int y = 1; y < 3; y++) {
        	a_values[y] = values[y][0] - b_values[0];
        }
        
        for (int y = 0; y < 3; y++) {
        	for (int x = 0; x < 3; x++) {
        		if (values[y][x] != a_values[y] + b_values[x]) {
        			System.out.println("No");
        			return;
        		}
        	}
        }
        System.out.println("Yes");
    }
} import java.util.*; util.* java public  class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] values = new int[3][3];
        for (int y = 0; y < 3; y++) {
        	for (int x = 0; x < 3; x++) {
        		values[y][x] = sc.nextInt();
        	}
        }
        
        int[] a_values = new int[3];
        int[] b_values = new int[3];
        a_values[0] = 0;
        for (int x = 0; x < 3; x++) {
        	b_values[x] = values[0][x];
        }
        for (int y = 1; y < 3; y++) {
        	a_values[y] = values[y][0] - b_values[0];
        }
        
        for (int y = 0; y < 3; y++) {
        	for (int x = 0; x < 3; x++) {
        		if (values[y][x] != a_values[y] + b_values[x]) {
        			System.out.println("No");
        			return;
        		}
        	}
        }
        System.out.println("Yes");
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] values = new int[3][3];
        for (int y = 0; y < 3; y++) {
        	for (int x = 0; x < 3; x++) {
        		values[y][x] = sc.nextInt();
        	}
        }
        
        int[] a_values = new int[3];
        int[] b_values = new int[3];
        a_values[0] = 0;
        for (int x = 0; x < 3; x++) {
        	b_values[x] = values[0][x];
        }
        for (int y = 1; y < 3; y++) {
        	a_values[y] = values[y][0] - b_values[0];
        }
        
        for (int y = 0; y < 3; y++) {
        	for (int x = 0; x < 3; x++) {
        		if (values[y][x] != a_values[y] + b_values[x]) {
        			System.out.println("No");
        			return;
        		}
        	}
        }
        System.out.println("Yes");
    } main {
        Scanner sc = new Scanner(System.in);
        int[][] values = new int[3][3];
        for (int y = 0; y < 3; y++) {
        	for (int x = 0; x < 3; x++) {
        		values[y][x] = sc.nextInt();
        	}
        }
        
        int[] a_values = new int[3];
        int[] b_values = new int[3];
        a_values[0] = 0;
        for (int x = 0; x < 3; x++) {
        	b_values[x] = values[0][x];
        }
        for (int y = 1; y < 3; y++) {
        	a_values[y] = values[y][0] - b_values[0];
        }
        
        for (int y = 0; y < 3; y++) {
        	for (int x = 0; x < 3; x++) {
        		if (values[y][x] != a_values[y] + b_values[x]) {
        			System.out.println("No");
        			return;
        		}
        	}
        }
        System.out.println("Yes");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[][] values = new int[3][3]; values new int[3][3] 3 3 for (int y = 0; y < 3; y++) {
        	for (int x = 0; x < 3; x++) {
        		values[y][x] = sc.nextInt();
        	}
        } int y = 0; int y = 0; y 0 y < 3 y 3 y++ y++ y {
        	for (int x = 0; x < 3; x++) {
        		values[y][x] = sc.nextInt();
        	}
        } {
        	for (int x = 0; x < 3; x++) {
        		values[y][x] = sc.nextInt();
        	}
        } for (int x = 0; x < 3; x++) {
        		values[y][x] = sc.nextInt();
        	} int x = 0; int x = 0; x 0 x < 3 x 3 x++ x++ x {
        		values[y][x] = sc.nextInt();
        	} {
        		values[y][x] = sc.nextInt();
        	} values[y][x] = sc.nextInt() values[y][x] values[y] values y x sc.nextInt() sc.nextInt sc int[] a_values = new int[3]; a_values new int[3] 3 int[] b_values = new int[3]; b_values new int[3] 3 a_values[0] = 0 a_values[0] a_values 0 0 for (int x = 0; x < 3; x++) {
        	b_values[x] = values[0][x];
        } int x = 0; int x = 0; x 0 x < 3 x 3 x++ x++ x {
        	b_values[x] = values[0][x];
        } {
        	b_values[x] = values[0][x];
        } b_values[x] = values[0][x] b_values[x] b_values x values[0][x] values[0] values 0 x for (int y = 1; y < 3; y++) {
        	a_values[y] = values[y][0] - b_values[0];
        } int y = 1; int y = 1; y 1 y < 3 y 3 y++ y++ y {
        	a_values[y] = values[y][0] - b_values[0];
        } {
        	a_values[y] = values[y][0] - b_values[0];
        } a_values[y] = values[y][0] - b_values[0] a_values[y] a_values y values[y][0] - b_values[0] values[y][0] values[y] values y 0 b_values[0] b_values 0 for (int y = 0; y < 3; y++) {
        	for (int x = 0; x < 3; x++) {
        		if (values[y][x] != a_values[y] + b_values[x]) {
        			System.out.println("No");
        			return;
        		}
        	}
        } int y = 0; int y = 0; y 0 y < 3 y 3 y++ y++ y {
        	for (int x = 0; x < 3; x++) {
        		if (values[y][x] != a_values[y] + b_values[x]) {
        			System.out.println("No");
        			return;
        		}
        	}
        } {
        	for (int x = 0; x < 3; x++) {
        		if (values[y][x] != a_values[y] + b_values[x]) {
        			System.out.println("No");
        			return;
        		}
        	}
        } for (int x = 0; x < 3; x++) {
        		if (values[y][x] != a_values[y] + b_values[x]) {
        			System.out.println("No");
        			return;
        		}
        	} int x = 0; int x = 0; x 0 x < 3 x 3 x++ x++ x {
        		if (values[y][x] != a_values[y] + b_values[x]) {
        			System.out.println("No");
        			return;
        		}
        	} {
        		if (values[y][x] != a_values[y] + b_values[x]) {
        			System.out.println("No");
        			return;
        		}
        	} if (values[y][x] != a_values[y] + b_values[x]) {
        			System.out.println("No");
        			return;
        		} values[y][x] != a_values[y] + b_values[x] values[y][x] values[y] values y x a_values[y] + b_values[x] a_values[y] a_values y b_values[x] b_values x {
        			System.out.println("No");
        			return;
        		} System.out.println("No") System.out.println System.out System System.out "No" return; 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) {
        Scanner sc = new Scanner(System.in);
        int[][] values = new int[3][3];
        for (int y = 0; y < 3; y++) {
        	for (int x = 0; x < 3; x++) {
        		values[y][x] = sc.nextInt();
        	}
        }
        
        int[] a_values = new int[3];
        int[] b_values = new int[3];
        a_values[0] = 0;
        for (int x = 0; x < 3; x++) {
        	b_values[x] = values[0][x];
        }
        for (int y = 1; y < 3; y++) {
        	a_values[y] = values[y][0] - b_values[0];
        }
        
        for (int y = 0; y < 3; y++) {
        	for (int x = 0; x < 3; x++) {
        		if (values[y][x] != a_values[y] + b_values[x]) {
        			System.out.println("No");
        			return;
        		}
        	}
        }
        System.out.println("Yes");
    }
} public  class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] values = new int[3][3];
        for (int y = 0; y < 3; y++) {
        	for (int x = 0; x < 3; x++) {
        		values[y][x] = sc.nextInt();
        	}
        }
        
        int[] a_values = new int[3];
        int[] b_values = new int[3];
        a_values[0] = 0;
        for (int x = 0; x < 3; x++) {
        	b_values[x] = values[0][x];
        }
        for (int y = 1; y < 3; y++) {
        	a_values[y] = values[y][0] - b_values[0];
        }
        
        for (int y = 0; y < 3; y++) {
        	for (int x = 0; x < 3; x++) {
        		if (values[y][x] != a_values[y] + b_values[x]) {
        			System.out.println("No");
        			return;
        		}
        	}
        }
        System.out.println("Yes");
    }
} Main
import java.util.*;


public  class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[][] values = new int[3][3];
        for (int y = 0; y < 3; y++) {
        	for (int x = 0; x < 3; x++) {
        		values[y][x] = sc.nextInt();
        	}
        }
        
        int[] a_values = new int[3];
        int[] b_values = new int[3];
        a_values[0] = 0;
        for (int x = 0; x < 3; x++) {
        	b_values[x] = values[0][x];
        }
        for (int y = 1; y < 3; y++) {
        	a_values[y] = values[y][0] - b_values[0];
        }
        
        for (int y = 0; y < 3; y++) {
        	for (int x = 0; x < 3; x++) {
        		if (values[y][x] != a_values[y] + b_values[x]) {
        			System.out.println("No");
        			return;
        		}
        	}
        }
        System.out.println("Yes");
    }
}