import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;



 
 
public class Main {
	
	public static void main(String[] args) throws IOException {
		Main m = new Main();
		//*
		m.input();
		m.solve();
		m.output();
		/*/
		m.debug();
		//*/
	}
	
	public void debug() {
	}
	
	/*
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String S = null;
	/*/
	InputUtil in = new InputUtil();
	//*/
	PrintWriter out = new PrintWriter(System.out);
	
	int[][] c = new int[3][3];
	
//	int ans = -1;
	boolean ans = true;
	
	
	
	
	public void input() throws IOException {
		for (int i=0; i<3; i++) {
			for (int j=0; j<3; j++) {
				c[i][j] = in.nextInt();
			}
		}
	}
	
	public void solve() throws IOException {
		for (int i=0; i<2; i++) {
			int dj0 = c[i+1][0]-c[i][0];
			int dj1 = c[i+1][1]-c[i][1];
			int dj2 = c[i+1][2]-c[i][2];
			if (dj0 != dj1 || dj1 != dj2) {
				ans = false;
				return;
			}
		}
		for (int j=0; j<2; j++) {
			int di0 = c[0][j+1]-c[0][j];
			int di1 = c[1][j+1]-c[1][j];
			int di2 = c[2][j+1]-c[2][j];
			if (di0 != di1 || di1 != di2) {
				ans = false;
				return;
			}
		}
	}

	
	public void output() {
		out.println(ans ? "Yes" : "No");
		out.flush();
	}
}

class Point {
	int y;
	int x;
	public Point(int y, int x) {
		this.x=x;
		this.y=y;
	}
	
	public Point move(Point d) {
		Point p = new Point(y, x);
		p.x += d.x;
		p.y += d.y;
		return p;
	}
	
}

class InputUtil {
	//Static Fields
	private static final int BUFSIZ = 100000;
	
	//Fields
	protected InputStream in;
	private byte[] buf = null;
	private int ptr = 0;
	private int max = -1;
	private DataInputStream dis = null;
	//Constructors
	public InputUtil() {this(System.in,BUFSIZ);}
	public InputUtil(InputStream in, int bufsiz) {
		initBuf(bufsiz);
		initIn(in);
	}
	
	//Methods
	//Initializer
	protected void initIn(InputStream in) {dis = new DataInputStream(this.in = in);}
	protected void initBuf(int bufsiz) {buf = new byte[bufsiz];}
	
	//buffer operation
	private void next() throws IOException {ptr++; readBuf();}
	private void readBuf() throws IOException {
		if(ptr >= max && dis.available()>0) {
			if(max>0) Arrays.fill(buf,0,max,(byte)0);
			max = dis.read(buf);
			ptr = 0;
		}
	}
	
	//Number Input Reader/Parser
	private boolean isNum(byte b) {return '0' <= b && b <= '9'; }
	private boolean isMinus(byte b) {return b=='-'; }

	private int _nextInt() throws IOException {
		int sign = 1;
		int res = 0;
		byte c;
		while (!isNum(c=buf[ptr]) && !isMinus(c)) 
			next();
		if (isMinus(buf[ptr])) {
			sign = -1;
			next();
		}
		while (isNum(c=buf[ptr])) {
			res *= 10;
			res += c - '0' ;
			next();
		}
		next();
		return sign * res;
	}
	
	public int nextInt() throws IOException {
		readBuf();
		return _nextInt();
	}

	public int[] nextInt(int[] result) throws IOException {
		readBuf();
		for(int i=0; i<result.length; i++) {
			result[i] = _nextInt();
		}
		return result;
	}
	
	//Close 
	public void close() throws IOException {
		if(!this.in.equals(System.in)) 
			this.in.close();
	}

} import java.io.DataInputStream; DataInputStream java.io import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.Arrays; Arrays java.util public class Main {
	
	public static void main(String[] args) throws IOException {
		Main m = new Main();
		//*
		m.input();
		m.solve();
		m.output();
		/*/
		m.debug();
		//*/
	}
	
	public void debug() {
	}
	
	/*
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String S = null;
	/*/
	InputUtil in = new InputUtil();
	//*/
	PrintWriter out = new PrintWriter(System.out);
	
	int[][] c = new int[3][3];
	
//	int ans = -1;
	boolean ans = true;
	
	
	
	
	public void input() throws IOException {
		for (int i=0; i<3; i++) {
			for (int j=0; j<3; j++) {
				c[i][j] = in.nextInt();
			}
		}
	}
	
	public void solve() throws IOException {
		for (int i=0; i<2; i++) {
			int dj0 = c[i+1][0]-c[i][0];
			int dj1 = c[i+1][1]-c[i][1];
			int dj2 = c[i+1][2]-c[i][2];
			if (dj0 != dj1 || dj1 != dj2) {
				ans = false;
				return;
			}
		}
		for (int j=0; j<2; j++) {
			int di0 = c[0][j+1]-c[0][j];
			int di1 = c[1][j+1]-c[1][j];
			int di2 = c[2][j+1]-c[2][j];
			if (di0 != di1 || di1 != di2) {
				ans = false;
				return;
			}
		}
	}

	
	public void output() {
		out.println(ans ? "Yes" : "No");
		out.flush();
	}
} Main /*
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String S = null;
	/*/
	InputUtil in = new InputUtil(); in new InputUtil() //*/
	PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) int[][] c = new int[3][3]; c new int[3][3] 3 3 //	int ans = -1;
	boolean ans = true; ans true public static void main(String[] args) throws IOException {
		Main m = new Main();
		//*
		m.input();
		m.solve();
		m.output();
		/*/
		m.debug();
		//*/
	} main {
		Main m = new Main();
		//*
		m.input();
		m.solve();
		m.output();
		/*/
		m.debug();
		//*/
	} Main m = new Main(); m new Main() m.input() m.input m m.solve() m.solve m m.output() m.output m String[] args args public void debug() {
	} debug {
	} public void input() throws IOException {
		for (int i=0; i<3; i++) {
			for (int j=0; j<3; j++) {
				c[i][j] = in.nextInt();
			}
		}
	} input {
		for (int i=0; i<3; i++) {
			for (int j=0; j<3; j++) {
				c[i][j] = in.nextInt();
			}
		}
	} for (int i=0; i<3; i++) {
			for (int j=0; j<3; j++) {
				c[i][j] = in.nextInt();
			}
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			for (int j=0; j<3; j++) {
				c[i][j] = in.nextInt();
			}
		} {
			for (int j=0; j<3; j++) {
				c[i][j] = in.nextInt();
			}
		} for (int j=0; j<3; j++) {
				c[i][j] = in.nextInt();
			} int j=0; int j=0; j 0 j<3 j 3 j++ j++ j {
				c[i][j] = in.nextInt();
			} {
				c[i][j] = in.nextInt();
			} c[i][j] = in.nextInt() c[i][j] c[i] c i j in.nextInt() in.nextInt in public void solve() throws IOException {
		for (int i=0; i<2; i++) {
			int dj0 = c[i+1][0]-c[i][0];
			int dj1 = c[i+1][1]-c[i][1];
			int dj2 = c[i+1][2]-c[i][2];
			if (dj0 != dj1 || dj1 != dj2) {
				ans = false;
				return;
			}
		}
		for (int j=0; j<2; j++) {
			int di0 = c[0][j+1]-c[0][j];
			int di1 = c[1][j+1]-c[1][j];
			int di2 = c[2][j+1]-c[2][j];
			if (di0 != di1 || di1 != di2) {
				ans = false;
				return;
			}
		}
	} solve {
		for (int i=0; i<2; i++) {
			int dj0 = c[i+1][0]-c[i][0];
			int dj1 = c[i+1][1]-c[i][1];
			int dj2 = c[i+1][2]-c[i][2];
			if (dj0 != dj1 || dj1 != dj2) {
				ans = false;
				return;
			}
		}
		for (int j=0; j<2; j++) {
			int di0 = c[0][j+1]-c[0][j];
			int di1 = c[1][j+1]-c[1][j];
			int di2 = c[2][j+1]-c[2][j];
			if (di0 != di1 || di1 != di2) {
				ans = false;
				return;
			}
		}
	} for (int i=0; i<2; i++) {
			int dj0 = c[i+1][0]-c[i][0];
			int dj1 = c[i+1][1]-c[i][1];
			int dj2 = c[i+1][2]-c[i][2];
			if (dj0 != dj1 || dj1 != dj2) {
				ans = false;
				return;
			}
		} int i=0; int i=0; i 0 i<2 i 2 i++ i++ i {
			int dj0 = c[i+1][0]-c[i][0];
			int dj1 = c[i+1][1]-c[i][1];
			int dj2 = c[i+1][2]-c[i][2];
			if (dj0 != dj1 || dj1 != dj2) {
				ans = false;
				return;
			}
		} {
			int dj0 = c[i+1][0]-c[i][0];
			int dj1 = c[i+1][1]-c[i][1];
			int dj2 = c[i+1][2]-c[i][2];
			if (dj0 != dj1 || dj1 != dj2) {
				ans = false;
				return;
			}
		} int dj0 = c[i+1][0]-c[i][0]; dj0 c[i+1][0]-c[i][0] c[i+1][0] c[i+1] c i+1 i 1 0 c[i][0] c[i] c i 0 int dj1 = c[i+1][1]-c[i][1]; dj1 c[i+1][1]-c[i][1] c[i+1][1] c[i+1] c i+1 i 1 1 c[i][1] c[i] c i 1 int dj2 = c[i+1][2]-c[i][2]; dj2 c[i+1][2]-c[i][2] c[i+1][2] c[i+1] c i+1 i 1 2 c[i][2] c[i] c i 2 if (dj0 != dj1 || dj1 != dj2) {
				ans = false;
				return;
			} dj0 != dj1 || dj1 != dj2 dj0 != dj1 dj0 dj1 dj1 != dj2 dj1 dj2 {
				ans = false;
				return;
			} ans = false ans false return; for (int j=0; j<2; j++) {
			int di0 = c[0][j+1]-c[0][j];
			int di1 = c[1][j+1]-c[1][j];
			int di2 = c[2][j+1]-c[2][j];
			if (di0 != di1 || di1 != di2) {
				ans = false;
				return;
			}
		} int j=0; int j=0; j 0 j<2 j 2 j++ j++ j {
			int di0 = c[0][j+1]-c[0][j];
			int di1 = c[1][j+1]-c[1][j];
			int di2 = c[2][j+1]-c[2][j];
			if (di0 != di1 || di1 != di2) {
				ans = false;
				return;
			}
		} {
			int di0 = c[0][j+1]-c[0][j];
			int di1 = c[1][j+1]-c[1][j];
			int di2 = c[2][j+1]-c[2][j];
			if (di0 != di1 || di1 != di2) {
				ans = false;
				return;
			}
		} int di0 = c[0][j+1]-c[0][j]; di0 c[0][j+1]-c[0][j] c[0][j+1] c[0] c 0 j+1 j 1 c[0][j] c[0] c 0 j int di1 = c[1][j+1]-c[1][j]; di1 c[1][j+1]-c[1][j] c[1][j+1] c[1] c 1 j+1 j 1 c[1][j] c[1] c 1 j int di2 = c[2][j+1]-c[2][j]; di2 c[2][j+1]-c[2][j] c[2][j+1] c[2] c 2 j+1 j 1 c[2][j] c[2] c 2 j if (di0 != di1 || di1 != di2) {
				ans = false;
				return;
			} di0 != di1 || di1 != di2 di0 != di1 di0 di1 di1 != di2 di1 di2 {
				ans = false;
				return;
			} ans = false ans false return; public void output() {
		out.println(ans ? "Yes" : "No");
		out.flush();
	} output {
		out.println(ans ? "Yes" : "No");
		out.flush();
	} out.println(ans ? "Yes" : "No") out.println out ans ? "Yes" : "No" ans "Yes" "No" out.flush() out.flush out class Point {
	int y;
	int x;
	public Point(int y, int x) {
		this.x=x;
		this.y=y;
	}
	
	public Point move(Point d) {
		Point p = new Point(y, x);
		p.x += d.x;
		p.y += d.y;
		return p;
	}
	
} Point int y; y int x; x public Point(int y, int x) {
		this.x=x;
		this.y=y;
	} Point {
		this.x=x;
		this.y=y;
	} this.x=x this.x this this.x x this.y=y this.y this this.y y int y y int x x public Point move(Point d) {
		Point p = new Point(y, x);
		p.x += d.x;
		p.y += d.y;
		return p;
	} move {
		Point p = new Point(y, x);
		p.x += d.x;
		p.y += d.y;
		return p;
	} Point p = new Point(y, x); p new Point(y, x) p.x += d.x p.x p p.x d.x d d.x p.y += d.y p.y p p.y d.y d d.y return p; p Point d d class InputUtil {
	//Static Fields
	private static final int BUFSIZ = 100000;
	
	//Fields
	protected InputStream in;
	private byte[] buf = null;
	private int ptr = 0;
	private int max = -1;
	private DataInputStream dis = null;
	//Constructors
	public InputUtil() {this(System.in,BUFSIZ);}
	public InputUtil(InputStream in, int bufsiz) {
		initBuf(bufsiz);
		initIn(in);
	}
	
	//Methods
	//Initializer
	protected void initIn(InputStream in) {dis = new DataInputStream(this.in = in);}
	protected void initBuf(int bufsiz) {buf = new byte[bufsiz];}
	
	//buffer operation
	private void next() throws IOException {ptr++; readBuf();}
	private void readBuf() throws IOException {
		if(ptr >= max && dis.available()>0) {
			if(max>0) Arrays.fill(buf,0,max,(byte)0);
			max = dis.read(buf);
			ptr = 0;
		}
	}
	
	//Number Input Reader/Parser
	private boolean isNum(byte b) {return '0' <= b && b <= '9'; }
	private boolean isMinus(byte b) {return b=='-'; }

	private int _nextInt() throws IOException {
		int sign = 1;
		int res = 0;
		byte c;
		while (!isNum(c=buf[ptr]) && !isMinus(c)) 
			next();
		if (isMinus(buf[ptr])) {
			sign = -1;
			next();
		}
		while (isNum(c=buf[ptr])) {
			res *= 10;
			res += c - '0' ;
			next();
		}
		next();
		return sign * res;
	}
	
	public int nextInt() throws IOException {
		readBuf();
		return _nextInt();
	}

	public int[] nextInt(int[] result) throws IOException {
		readBuf();
		for(int i=0; i<result.length; i++) {
			result[i] = _nextInt();
		}
		return result;
	}
	
	//Close 
	public void close() throws IOException {
		if(!this.in.equals(System.in)) 
			this.in.close();
	}

} InputUtil //Static Fields
	private static final int BUFSIZ = 100000; BUFSIZ 100000 //Fields
	protected InputStream in; in private byte[] buf = null; buf null private int ptr = 0; ptr 0 private int max = -1; max -1 1 private DataInputStream dis = null; dis null //Constructors
	public InputUtil() {this(System.in,BUFSIZ);} InputUtil {this(System.in,BUFSIZ);} this(System.in,BUFSIZ) this System.in System System.in BUFSIZ public InputUtil(InputStream in, int bufsiz) {
		initBuf(bufsiz);
		initIn(in);
	} InputUtil {
		initBuf(bufsiz);
		initIn(in);
	} initBuf(bufsiz) initBuf bufsiz initIn(in) initIn in InputStream in in int bufsiz bufsiz //Methods
	//Initializer
	protected void initIn(InputStream in) {dis = new DataInputStream(this.in = in);} initIn {dis = new DataInputStream(this.in = in);} dis = new DataInputStream(this.in = in) dis new DataInputStream(this.in = in) InputStream in in protected void initBuf(int bufsiz) {buf = new byte[bufsiz];} initBuf {buf = new byte[bufsiz];} buf = new byte[bufsiz] buf new byte[bufsiz] bufsiz int bufsiz bufsiz //buffer operation
	private void next() throws IOException {ptr++; readBuf();} next {ptr++; readBuf();} ptr++ ptr readBuf() readBuf private void readBuf() throws IOException {
		if(ptr >= max && dis.available()>0) {
			if(max>0) Arrays.fill(buf,0,max,(byte)0);
			max = dis.read(buf);
			ptr = 0;
		}
	} readBuf {
		if(ptr >= max && dis.available()>0) {
			if(max>0) Arrays.fill(buf,0,max,(byte)0);
			max = dis.read(buf);
			ptr = 0;
		}
	} if(ptr >= max && dis.available()>0) {
			if(max>0) Arrays.fill(buf,0,max,(byte)0);
			max = dis.read(buf);
			ptr = 0;
		} ptr >= max && dis.available()>0 ptr >= max ptr max dis.available()>0 dis.available() dis.available dis 0 {
			if(max>0) Arrays.fill(buf,0,max,(byte)0);
			max = dis.read(buf);
			ptr = 0;
		} if(max>0) Arrays.fill(buf,0,max,(byte)0); max>0 max 0 Arrays.fill(buf,0,max,(byte)0) Arrays.fill Arrays buf 0 max (byte)0 max = dis.read(buf) max dis.read(buf) dis.read dis buf ptr = 0 ptr 0 //Number Input Reader/Parser
	private boolean isNum(byte b) {return '0' <= b && b <= '9'; } isNum {return '0' <= b && b <= '9'; } return '0' <= b && b <= '9'; '0' <= b && b <= '9' '0' <= b '0' b b <= '9' b '9' byte b b private boolean isMinus(byte b) {return b=='-'; } isMinus {return b=='-'; } return b=='-'; b=='-' b '-' byte b b private int _nextInt() throws IOException {
		int sign = 1;
		int res = 0;
		byte c;
		while (!isNum(c=buf[ptr]) && !isMinus(c)) 
			next();
		if (isMinus(buf[ptr])) {
			sign = -1;
			next();
		}
		while (isNum(c=buf[ptr])) {
			res *= 10;
			res += c - '0' ;
			next();
		}
		next();
		return sign * res;
	} _nextInt {
		int sign = 1;
		int res = 0;
		byte c;
		while (!isNum(c=buf[ptr]) && !isMinus(c)) 
			next();
		if (isMinus(buf[ptr])) {
			sign = -1;
			next();
		}
		while (isNum(c=buf[ptr])) {
			res *= 10;
			res += c - '0' ;
			next();
		}
		next();
		return sign * res;
	} int sign = 1; sign 1 int res = 0; res 0 byte c; c while (!isNum(c=buf[ptr]) && !isMinus(c)) 
			next(); !isNum(c=buf[ptr]) && !isMinus(c) !isNum(c=buf[ptr]) isNum(c=buf[ptr]) isNum c=buf[ptr] c buf[ptr] buf ptr !isMinus(c) isMinus(c) isMinus c next() next if (isMinus(buf[ptr])) {
			sign = -1;
			next();
		} isMinus(buf[ptr]) isMinus buf[ptr] buf ptr {
			sign = -1;
			next();
		} sign = -1 sign -1 1 next() next while (isNum(c=buf[ptr])) {
			res *= 10;
			res += c - '0' ;
			next();
		} isNum(c=buf[ptr]) isNum c=buf[ptr] c buf[ptr] buf ptr {
			res *= 10;
			res += c - '0' ;
			next();
		} res *= 10 res 10 res += c - '0' res c - '0' c '0' next() next next() next return sign * res; sign * res sign res public int nextInt() throws IOException {
		readBuf();
		return _nextInt();
	} nextInt {
		readBuf();
		return _nextInt();
	} readBuf() readBuf return _nextInt(); _nextInt() _nextInt public int[] nextInt(int[] result) throws IOException {
		readBuf();
		for(int i=0; i<result.length; i++) {
			result[i] = _nextInt();
		}
		return result;
	} nextInt {
		readBuf();
		for(int i=0; i<result.length; i++) {
			result[i] = _nextInt();
		}
		return result;
	} readBuf() readBuf for(int i=0; i<result.length; i++) {
			result[i] = _nextInt();
		} int i=0; int i=0; i 0 i<result.length i result.length result result.length i++ i++ i {
			result[i] = _nextInt();
		} {
			result[i] = _nextInt();
		} result[i] = _nextInt() result[i] result i _nextInt() _nextInt return result; result int[] result result //Close 
	public void close() throws IOException {
		if(!this.in.equals(System.in)) 
			this.in.close();
	} close {
		if(!this.in.equals(System.in)) 
			this.in.close();
	} if(!this.in.equals(System.in)) 
			this.in.close(); !this.in.equals(System.in) this.in.equals(System.in) this.in.equals this.in this this.in System.in System System.in this.in.close() this.in.close this.in this this.in public class Main {
	
	public static void main(String[] args) throws IOException {
		Main m = new Main();
		//*
		m.input();
		m.solve();
		m.output();
		/*/
		m.debug();
		//*/
	}
	
	public void debug() {
	}
	
	/*
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String S = null;
	/*/
	InputUtil in = new InputUtil();
	//*/
	PrintWriter out = new PrintWriter(System.out);
	
	int[][] c = new int[3][3];
	
//	int ans = -1;
	boolean ans = true;
	
	
	
	
	public void input() throws IOException {
		for (int i=0; i<3; i++) {
			for (int j=0; j<3; j++) {
				c[i][j] = in.nextInt();
			}
		}
	}
	
	public void solve() throws IOException {
		for (int i=0; i<2; i++) {
			int dj0 = c[i+1][0]-c[i][0];
			int dj1 = c[i+1][1]-c[i][1];
			int dj2 = c[i+1][2]-c[i][2];
			if (dj0 != dj1 || dj1 != dj2) {
				ans = false;
				return;
			}
		}
		for (int j=0; j<2; j++) {
			int di0 = c[0][j+1]-c[0][j];
			int di1 = c[1][j+1]-c[1][j];
			int di2 = c[2][j+1]-c[2][j];
			if (di0 != di1 || di1 != di2) {
				ans = false;
				return;
			}
		}
	}

	
	public void output() {
		out.println(ans ? "Yes" : "No");
		out.flush();
	}
} public class Main {
	
	public static void main(String[] args) throws IOException {
		Main m = new Main();
		//*
		m.input();
		m.solve();
		m.output();
		/*/
		m.debug();
		//*/
	}
	
	public void debug() {
	}
	
	/*
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String S = null;
	/*/
	InputUtil in = new InputUtil();
	//*/
	PrintWriter out = new PrintWriter(System.out);
	
	int[][] c = new int[3][3];
	
//	int ans = -1;
	boolean ans = true;
	
	
	
	
	public void input() throws IOException {
		for (int i=0; i<3; i++) {
			for (int j=0; j<3; j++) {
				c[i][j] = in.nextInt();
			}
		}
	}
	
	public void solve() throws IOException {
		for (int i=0; i<2; i++) {
			int dj0 = c[i+1][0]-c[i][0];
			int dj1 = c[i+1][1]-c[i][1];
			int dj2 = c[i+1][2]-c[i][2];
			if (dj0 != dj1 || dj1 != dj2) {
				ans = false;
				return;
			}
		}
		for (int j=0; j<2; j++) {
			int di0 = c[0][j+1]-c[0][j];
			int di1 = c[1][j+1]-c[1][j];
			int di2 = c[2][j+1]-c[2][j];
			if (di0 != di1 || di1 != di2) {
				ans = false;
				return;
			}
		}
	}

	
	public void output() {
		out.println(ans ? "Yes" : "No");
		out.flush();
	}
} Main
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;



 
 
public class Main {
	
	public static void main(String[] args) throws IOException {
		Main m = new Main();
		//*
		m.input();
		m.solve();
		m.output();
		/*/
		m.debug();
		//*/
	}
	
	public void debug() {
	}
	
	/*
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String S = null;
	/*/
	InputUtil in = new InputUtil();
	//*/
	PrintWriter out = new PrintWriter(System.out);
	
	int[][] c = new int[3][3];
	
//	int ans = -1;
	boolean ans = true;
	
	
	
	
	public void input() throws IOException {
		for (int i=0; i<3; i++) {
			for (int j=0; j<3; j++) {
				c[i][j] = in.nextInt();
			}
		}
	}
	
	public void solve() throws IOException {
		for (int i=0; i<2; i++) {
			int dj0 = c[i+1][0]-c[i][0];
			int dj1 = c[i+1][1]-c[i][1];
			int dj2 = c[i+1][2]-c[i][2];
			if (dj0 != dj1 || dj1 != dj2) {
				ans = false;
				return;
			}
		}
		for (int j=0; j<2; j++) {
			int di0 = c[0][j+1]-c[0][j];
			int di1 = c[1][j+1]-c[1][j];
			int di2 = c[2][j+1]-c[2][j];
			if (di0 != di1 || di1 != di2) {
				ans = false;
				return;
			}
		}
	}

	
	public void output() {
		out.println(ans ? "Yes" : "No");
		out.flush();
	}
}

class Point {
	int y;
	int x;
	public Point(int y, int x) {
		this.x=x;
		this.y=y;
	}
	
	public Point move(Point d) {
		Point p = new Point(y, x);
		p.x += d.x;
		p.y += d.y;
		return p;
	}
	
}

class InputUtil {
	//Static Fields
	private static final int BUFSIZ = 100000;
	
	//Fields
	protected InputStream in;
	private byte[] buf = null;
	private int ptr = 0;
	private int max = -1;
	private DataInputStream dis = null;
	//Constructors
	public InputUtil() {this(System.in,BUFSIZ);}
	public InputUtil(InputStream in, int bufsiz) {
		initBuf(bufsiz);
		initIn(in);
	}
	
	//Methods
	//Initializer
	protected void initIn(InputStream in) {dis = new DataInputStream(this.in = in);}
	protected void initBuf(int bufsiz) {buf = new byte[bufsiz];}
	
	//buffer operation
	private void next() throws IOException {ptr++; readBuf();}
	private void readBuf() throws IOException {
		if(ptr >= max && dis.available()>0) {
			if(max>0) Arrays.fill(buf,0,max,(byte)0);
			max = dis.read(buf);
			ptr = 0;
		}
	}
	
	//Number Input Reader/Parser
	private boolean isNum(byte b) {return '0' <= b && b <= '9'; }
	private boolean isMinus(byte b) {return b=='-'; }

	private int _nextInt() throws IOException {
		int sign = 1;
		int res = 0;
		byte c;
		while (!isNum(c=buf[ptr]) && !isMinus(c)) 
			next();
		if (isMinus(buf[ptr])) {
			sign = -1;
			next();
		}
		while (isNum(c=buf[ptr])) {
			res *= 10;
			res += c - '0' ;
			next();
		}
		next();
		return sign * res;
	}
	
	public int nextInt() throws IOException {
		readBuf();
		return _nextInt();
	}

	public int[] nextInt(int[] result) throws IOException {
		readBuf();
		for(int i=0; i<result.length; i++) {
			result[i] = _nextInt();
		}
		return result;
	}
	
	//Close 
	public void close() throws IOException {
		if(!this.in.equals(System.in)) 
			this.in.close();
	}

}
