import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException{
		TakashiInfo solver = new TakashiInfo();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	}

	static class TakashiInfo {

		private int map[][] = new int[3][3];

		private Scanner scanner;
		private String output;

		public TakashiInfo() {
			scanner = new Scanner(System.in);
		}

		public void readInput() {
			for(int i=0; i<3; i++) {
				for(int j=0; j<3; j++) {
					map[i][j] = Integer.parseInt(scanner.next());
				}
			}
		}
		public void solve() {
			for(int i=0;i<3;i++) {
				for(int j=1; j<3; j++) {
					map[i][j]-= map[i][0];
				}
			}
			output = (map[0][1]==map[1][1] && map[1][1]==map[2][1] && map[0][2]==map[1][2] && map[1][2]==map[2][2])? "Yes":"No";
		}


		public void writeOutput() {
			System.out.println(output);
		}
	}

} import java.io.IOException; IOException java.io import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) throws IOException{
		TakashiInfo solver = new TakashiInfo();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	}

	static class TakashiInfo {

		private int map[][] = new int[3][3];

		private Scanner scanner;
		private String output;

		public TakashiInfo() {
			scanner = new Scanner(System.in);
		}

		public void readInput() {
			for(int i=0; i<3; i++) {
				for(int j=0; j<3; j++) {
					map[i][j] = Integer.parseInt(scanner.next());
				}
			}
		}
		public void solve() {
			for(int i=0;i<3;i++) {
				for(int j=1; j<3; j++) {
					map[i][j]-= map[i][0];
				}
			}
			output = (map[0][1]==map[1][1] && map[1][1]==map[2][1] && map[0][2]==map[1][2] && map[1][2]==map[2][2])? "Yes":"No";
		}


		public void writeOutput() {
			System.out.println(output);
		}
	}

} Main public static void main(String[] args) throws IOException{
		TakashiInfo solver = new TakashiInfo();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	} main {
		TakashiInfo solver = new TakashiInfo();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	} TakashiInfo solver = new TakashiInfo(); solver new TakashiInfo() solver.readInput() solver.readInput solver solver.solve() solver.solve solver solver.writeOutput() solver.writeOutput solver String[] args args static class TakashiInfo {

		private int map[][] = new int[3][3];

		private Scanner scanner;
		private String output;

		public TakashiInfo() {
			scanner = new Scanner(System.in);
		}

		public void readInput() {
			for(int i=0; i<3; i++) {
				for(int j=0; j<3; j++) {
					map[i][j] = Integer.parseInt(scanner.next());
				}
			}
		}
		public void solve() {
			for(int i=0;i<3;i++) {
				for(int j=1; j<3; j++) {
					map[i][j]-= map[i][0];
				}
			}
			output = (map[0][1]==map[1][1] && map[1][1]==map[2][1] && map[0][2]==map[1][2] && map[1][2]==map[2][2])? "Yes":"No";
		}


		public void writeOutput() {
			System.out.println(output);
		}
	} TakashiInfo private int map[][] = new int[3][3]; map new int[3][3] 3 3 private Scanner scanner; scanner private String output; output public TakashiInfo() {
			scanner = new Scanner(System.in);
		} TakashiInfo {
			scanner = new Scanner(System.in);
		} scanner = new Scanner(System.in) scanner new Scanner(System.in) public void readInput() {
			for(int i=0; i<3; i++) {
				for(int j=0; j<3; j++) {
					map[i][j] = Integer.parseInt(scanner.next());
				}
			}
		} readInput {
			for(int i=0; i<3; i++) {
				for(int j=0; j<3; j++) {
					map[i][j] = Integer.parseInt(scanner.next());
				}
			}
		} for(int i=0; i<3; i++) {
				for(int j=0; j<3; j++) {
					map[i][j] = Integer.parseInt(scanner.next());
				}
			} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
				for(int j=0; j<3; j++) {
					map[i][j] = Integer.parseInt(scanner.next());
				}
			} {
				for(int j=0; j<3; j++) {
					map[i][j] = Integer.parseInt(scanner.next());
				}
			} for(int j=0; j<3; j++) {
					map[i][j] = Integer.parseInt(scanner.next());
				} int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
					map[i][j] = Integer.parseInt(scanner.next());
				} {
					map[i][j] = Integer.parseInt(scanner.next());
				} map[i][j] = Integer.parseInt(scanner.next()) map[i][j] map[i] map i j Integer.parseInt(scanner.next()) Integer.parseInt Integer scanner.next() scanner.next scanner public void solve() {
			for(int i=0;i<3;i++) {
				for(int j=1; j<3; j++) {
					map[i][j]-= map[i][0];
				}
			}
			output = (map[0][1]==map[1][1] && map[1][1]==map[2][1] && map[0][2]==map[1][2] && map[1][2]==map[2][2])? "Yes":"No";
		} solve {
			for(int i=0;i<3;i++) {
				for(int j=1; j<3; j++) {
					map[i][j]-= map[i][0];
				}
			}
			output = (map[0][1]==map[1][1] && map[1][1]==map[2][1] && map[0][2]==map[1][2] && map[1][2]==map[2][2])? "Yes":"No";
		} for(int i=0;i<3;i++) {
				for(int j=1; j<3; j++) {
					map[i][j]-= map[i][0];
				}
			} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
				for(int j=1; j<3; j++) {
					map[i][j]-= map[i][0];
				}
			} {
				for(int j=1; j<3; j++) {
					map[i][j]-= map[i][0];
				}
			} for(int j=1; j<3; j++) {
					map[i][j]-= map[i][0];
				} int j=1; int j=1; j 1 j<3 j 3 j++ j++ j {
					map[i][j]-= map[i][0];
				} {
					map[i][j]-= map[i][0];
				} map[i][j]-= map[i][0] map[i][j] map[i] map i j map[i][0] map[i] map i 0 output = (map[0][1]==map[1][1] && map[1][1]==map[2][1] && map[0][2]==map[1][2] && map[1][2]==map[2][2])? "Yes":"No" output (map[0][1]==map[1][1] && map[1][1]==map[2][1] && map[0][2]==map[1][2] && map[1][2]==map[2][2])? "Yes":"No" (map[0][1]==map[1][1] && map[1][1]==map[2][1] && map[0][2]==map[1][2] && map[1][2]==map[2][2]) map[0][2]==map[1][2] map[0][1]==map[1][1] && map[1][1]==map[2][1] && map[0][2]==map[1][2] && map[1][2]==map[2][2] map[0][1]==map[1][1] map[0][1] map[0] map 0 1 map[1][1] map[1] map 1 1 map[1][1]==map[2][1] map[1][1] map[1] map 1 1 map[2][1] map[2] map 2 1 map[0][2]==map[1][2] map[0][2] map[0] map 0 2 map[1][2] map[1] map 1 2 map[1][2]==map[2][2] map[1][2] map[1] map 1 2 map[2][2] map[2] map 2 2 "Yes" "No" public void writeOutput() {
			System.out.println(output);
		} writeOutput {
			System.out.println(output);
		} System.out.println(output) System.out.println System.out System System.out output public class Main {

	public static void main(String[] args) throws IOException{
		TakashiInfo solver = new TakashiInfo();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	}

	static class TakashiInfo {

		private int map[][] = new int[3][3];

		private Scanner scanner;
		private String output;

		public TakashiInfo() {
			scanner = new Scanner(System.in);
		}

		public void readInput() {
			for(int i=0; i<3; i++) {
				for(int j=0; j<3; j++) {
					map[i][j] = Integer.parseInt(scanner.next());
				}
			}
		}
		public void solve() {
			for(int i=0;i<3;i++) {
				for(int j=1; j<3; j++) {
					map[i][j]-= map[i][0];
				}
			}
			output = (map[0][1]==map[1][1] && map[1][1]==map[2][1] && map[0][2]==map[1][2] && map[1][2]==map[2][2])? "Yes":"No";
		}


		public void writeOutput() {
			System.out.println(output);
		}
	}

} public class Main {

	public static void main(String[] args) throws IOException{
		TakashiInfo solver = new TakashiInfo();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	}

	static class TakashiInfo {

		private int map[][] = new int[3][3];

		private Scanner scanner;
		private String output;

		public TakashiInfo() {
			scanner = new Scanner(System.in);
		}

		public void readInput() {
			for(int i=0; i<3; i++) {
				for(int j=0; j<3; j++) {
					map[i][j] = Integer.parseInt(scanner.next());
				}
			}
		}
		public void solve() {
			for(int i=0;i<3;i++) {
				for(int j=1; j<3; j++) {
					map[i][j]-= map[i][0];
				}
			}
			output = (map[0][1]==map[1][1] && map[1][1]==map[2][1] && map[0][2]==map[1][2] && map[1][2]==map[2][2])? "Yes":"No";
		}


		public void writeOutput() {
			System.out.println(output);
		}
	}

} Main
import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException{
		TakashiInfo solver = new TakashiInfo();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	}

	static class TakashiInfo {

		private int map[][] = new int[3][3];

		private Scanner scanner;
		private String output;

		public TakashiInfo() {
			scanner = new Scanner(System.in);
		}

		public void readInput() {
			for(int i=0; i<3; i++) {
				for(int j=0; j<3; j++) {
					map[i][j] = Integer.parseInt(scanner.next());
				}
			}
		}
		public void solve() {
			for(int i=0;i<3;i++) {
				for(int j=1; j<3; j++) {
					map[i][j]-= map[i][0];
				}
			}
			output = (map[0][1]==map[1][1] && map[1][1]==map[2][1] && map[0][2]==map[1][2] && map[1][2]==map[2][2])? "Yes":"No";
		}


		public void writeOutput() {
			System.out.println(output);
		}
	}

}
