import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.util.Random;
public class Main {
	static final long C =  1000000007;
	static final int CY = 1000000000;
	static final int INF = Integer.MAX_VALUE/2;
	StringBuilder sb;
	//セット
	class Set<F,S> {
		F f;
		S s;
		Set(F f, S s) {this.f = f;this.s = s;}
	}
	int[][] G;
	//Map<Integer,List<Integer>> Genb = new HashMap<>();
	int V;
	int E;
	int Venb;
	int Eenb;
	long START_TIME;
	int GenbSize;//Genbグラフの1辺
	Random rand = new Random();
	int[][] DIR = new int[][]{{0,1},{1,0},{-1,0},{0,-1}};

	public void calc() {

		sb = new StringBuilder();


		//入力処理
		IO sc = new IO();

		int[][] map = new int[3][3];
		for (int i=0; i<3; i++) {
			for (int t=0;t < 3;t++) {
				map[i][t] = sc.nextInt();
			}
		}

		boolean ans = true;

		for (int i=0; i < 2; i++) {
			if (map[i][0] - map[i+1][0] == map[i][1] - map[i+1][1] &&
					map[i][2] - map[i+1][2] == map[i][1] - map[i+1][1]){}
			else ans = false;
		}




		System.out.println(ans?"Yes":"No");

	}
	boolean isIn(int y, int x,int h,int w) {
		return 0 <= y && y < h && 0 <= x && x < w;
	}


	public static void main(String[] args) {
		Main main = new Main();
		main.calc();

	}
}
class IO extends PrintWriter {
	private final InputStream in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	public IO() { this(System.in);}
	public IO(InputStream source) { super(System.out); this.in = source;}
	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		}else{
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}
	private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
	private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
	private static boolean isNewLine(int c) { return c == '\n' || c == '\r';}
	public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
	public boolean hasNextLine() { while(hasNextByte() && isNewLine(buffer[ptr])) ptr++; return hasNextByte();}
	public String next() {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while(isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	public char[] nextCharArray(int len) {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		char[] s = new char[len];
		int i = 0;
		int b = readByte();
		while(isPrintableChar(b)) {
			if (i == len) {
				throw new InputMismatchException();
			}
			s[i++] = (char) b;
			b = readByte();
		}
		return s;
	}
	public String nextLine() {
		if (!hasNextLine()) {
			throw new NoSuchElementException();
		}
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while(!isNewLine(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	public long nextLong() {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			}else if(b == -1 || !isPrintableChar(b)){
				return minus ? -n : n;
			}else{
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}
	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {
			throw new NumberFormatException();
		}
		return (int) nl;
	}
	public char nextChar() {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		return (char) readByte();
	}
	public double nextDouble() { return Double.parseDouble(next());}
	public int[] nextIntArray(int n) { int[] a = new int[n]; for(int i=0;i<n;i++) a[i] = nextInt(); return a;}
	public long[] nextLongArray(int n) { long[] a = new long[n]; for(int i=0;i<n;i++) a[i] = nextLong(); return a;}
	public double[] nextDoubleArray(int n) { double[] a = new double[n]; for(int i=0;i<n;i++) a[i] = nextDouble(); return a;}
	public void nextIntArrays(int[]... a) { for(int i=0;i<a[0].length;i++) for(int j=0;j<a.length;j++) a[j][i] = nextInt();}
	public int[][] nextIntMatrix(int n,int m) { int[][] a = new int[n][]; for(int i=0;i<n;i++) a[i] = nextIntArray(m); return a;}
	public char[][] nextCharMap(int n,int m) { char[][] a = new char[n][]; for(int i=0;i<n;i++) a[i] = nextCharArray(m); return a;}
	public void close() { super.close(); try {in.close();} catch (IOException e) {}}
} import java.io.IOException; IOException java.io import java.io.InputStream; InputStream java.io import java.io.PrintWriter; PrintWriter java.io import java.util.InputMismatchException; InputMismatchException java.util import java.util.NoSuchElementException; NoSuchElementException java.util import java.util.Random; Random java.util public class Main {
	static final long C =  1000000007;
	static final int CY = 1000000000;
	static final int INF = Integer.MAX_VALUE/2;
	StringBuilder sb;
	//セット
	class Set<F,S> {
		F f;
		S s;
		Set(F f, S s) {this.f = f;this.s = s;}
	}
	int[][] G;
	//Map<Integer,List<Integer>> Genb = new HashMap<>();
	int V;
	int E;
	int Venb;
	int Eenb;
	long START_TIME;
	int GenbSize;//Genbグラフの1辺
	Random rand = new Random();
	int[][] DIR = new int[][]{{0,1},{1,0},{-1,0},{0,-1}};

	public void calc() {

		sb = new StringBuilder();


		//入力処理
		IO sc = new IO();

		int[][] map = new int[3][3];
		for (int i=0; i<3; i++) {
			for (int t=0;t < 3;t++) {
				map[i][t] = sc.nextInt();
			}
		}

		boolean ans = true;

		for (int i=0; i < 2; i++) {
			if (map[i][0] - map[i+1][0] == map[i][1] - map[i+1][1] &&
					map[i][2] - map[i+1][2] == map[i][1] - map[i+1][1]){}
			else ans = false;
		}




		System.out.println(ans?"Yes":"No");

	}
	boolean isIn(int y, int x,int h,int w) {
		return 0 <= y && y < h && 0 <= x && x < w;
	}


	public static void main(String[] args) {
		Main main = new Main();
		main.calc();

	}
} Main static final long C =  1000000007; C 1000000007 static final int CY = 1000000000; CY 1000000000 static final int INF = Integer.MAX_VALUE/2; INF Integer.MAX_VALUE/2 Integer.MAX_VALUE Integer Integer.MAX_VALUE 2 StringBuilder sb; sb int[][] G; G //Map<Integer,List<Integer>> Genb = new HashMap<>();
	int V; V int E; E int Venb; Venb int Eenb; Eenb long START_TIME; START_TIME int GenbSize;//Genbグラフの1辺 GenbSize Random rand = new Random(); rand new Random() int[][] DIR = new int[][]{{0,1},{1,0},{-1,0},{0,-1}}; DIR new int[][]{{0,1},{1,0},{-1,0},{0,-1}} public void calc() {

		sb = new StringBuilder();


		//入力処理
		IO sc = new IO();

		int[][] map = new int[3][3];
		for (int i=0; i<3; i++) {
			for (int t=0;t < 3;t++) {
				map[i][t] = sc.nextInt();
			}
		}

		boolean ans = true;

		for (int i=0; i < 2; i++) {
			if (map[i][0] - map[i+1][0] == map[i][1] - map[i+1][1] &&
					map[i][2] - map[i+1][2] == map[i][1] - map[i+1][1]){}
			else ans = false;
		}




		System.out.println(ans?"Yes":"No");

	} calc {

		sb = new StringBuilder();


		//入力処理
		IO sc = new IO();

		int[][] map = new int[3][3];
		for (int i=0; i<3; i++) {
			for (int t=0;t < 3;t++) {
				map[i][t] = sc.nextInt();
			}
		}

		boolean ans = true;

		for (int i=0; i < 2; i++) {
			if (map[i][0] - map[i+1][0] == map[i][1] - map[i+1][1] &&
					map[i][2] - map[i+1][2] == map[i][1] - map[i+1][1]){}
			else ans = false;
		}




		System.out.println(ans?"Yes":"No");

	} sb = new StringBuilder() sb new StringBuilder() IO sc = new IO(); sc new IO() int[][] map = new int[3][3]; map new int[3][3] 3 3 for (int i=0; i<3; i++) {
			for (int t=0;t < 3;t++) {
				map[i][t] = sc.nextInt();
			}
		} int i=0; int i=0; i 0 i<3 i 3 i++ i++ i {
			for (int t=0;t < 3;t++) {
				map[i][t] = sc.nextInt();
			}
		} {
			for (int t=0;t < 3;t++) {
				map[i][t] = sc.nextInt();
			}
		} for (int t=0;t < 3;t++) {
				map[i][t] = sc.nextInt();
			} int t=0; int t=0; t 0 t < 3 t 3 t++ t++ t {
				map[i][t] = sc.nextInt();
			} {
				map[i][t] = sc.nextInt();
			} map[i][t] = sc.nextInt() map[i][t] map[i] map i t sc.nextInt() sc.nextInt sc boolean ans = true; ans true for (int i=0; i < 2; i++) {
			if (map[i][0] - map[i+1][0] == map[i][1] - map[i+1][1] &&
					map[i][2] - map[i+1][2] == map[i][1] - map[i+1][1]){}
			else ans = false;
		} int i=0; int i=0; i 0 i < 2 i 2 i++ i++ i {
			if (map[i][0] - map[i+1][0] == map[i][1] - map[i+1][1] &&
					map[i][2] - map[i+1][2] == map[i][1] - map[i+1][1]){}
			else ans = false;
		} {
			if (map[i][0] - map[i+1][0] == map[i][1] - map[i+1][1] &&
					map[i][2] - map[i+1][2] == map[i][1] - map[i+1][1]){}
			else ans = false;
		} if (map[i][0] - map[i+1][0] == map[i][1] - map[i+1][1] &&
					map[i][2] - map[i+1][2] == map[i][1] - map[i+1][1]){}
			else ans = false; map[i][0] - map[i+1][0] == map[i][1] - map[i+1][1] &&
					map[i][2] - map[i+1][2] == map[i][1] - map[i+1][1] map[i][0] - map[i+1][0] == map[i][1] - map[i+1][1] map[i][0] - map[i+1][0] map[i][0] map[i] map i 0 map[i+1][0] map[i+1] map i+1 i 1 0 map[i][1] - map[i+1][1] map[i][1] map[i] map i 1 map[i+1][1] map[i+1] map i+1 i 1 1 map[i][2] - map[i+1][2] == map[i][1] - map[i+1][1] map[i][2] - map[i+1][2] map[i][2] map[i] map i 2 map[i+1][2] map[i+1] map i+1 i 1 2 map[i][1] - map[i+1][1] map[i][1] map[i] map i 1 map[i+1][1] map[i+1] map i+1 i 1 1 {} ans = false ans false System.out.println(ans?"Yes":"No") System.out.println System.out System System.out ans?"Yes":"No" ans "Yes" "No" boolean isIn(int y, int x,int h,int w) {
		return 0 <= y && y < h && 0 <= x && x < w;
	} isIn {
		return 0 <= y && y < h && 0 <= x && x < w;
	} return 0 <= y && y < h && 0 <= x && x < w; 0 <= y && y < h && 0 <= x && x < w 0 <= x 0 <= y && y < h && 0 <= x && x < w 0 <= y 0 y y < h y h 0 <= x 0 x x < w x w int y y int x x int h h int w w public static void main(String[] args) {
		Main main = new Main();
		main.calc();

	} main {
		Main main = new Main();
		main.calc();

	} Main main = new Main(); main new Main() main.calc() main.calc main String[] args args class Set<F,S> {
		F f;
		S s;
		Set(F f, S s) {this.f = f;this.s = s;}
	} Set F f; f S s; s Set(F f, S s) {this.f = f;this.s = s;} Set {this.f = f;this.s = s;} this.f = f this.f this this.f f this.s = s this.s this this.s s F f f S s s class IO extends PrintWriter {
	private final InputStream in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	public IO() { this(System.in);}
	public IO(InputStream source) { super(System.out); this.in = source;}
	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		}else{
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}
	private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
	private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
	private static boolean isNewLine(int c) { return c == '\n' || c == '\r';}
	public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
	public boolean hasNextLine() { while(hasNextByte() && isNewLine(buffer[ptr])) ptr++; return hasNextByte();}
	public String next() {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while(isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	public char[] nextCharArray(int len) {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		char[] s = new char[len];
		int i = 0;
		int b = readByte();
		while(isPrintableChar(b)) {
			if (i == len) {
				throw new InputMismatchException();
			}
			s[i++] = (char) b;
			b = readByte();
		}
		return s;
	}
	public String nextLine() {
		if (!hasNextLine()) {
			throw new NoSuchElementException();
		}
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while(!isNewLine(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	public long nextLong() {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			}else if(b == -1 || !isPrintableChar(b)){
				return minus ? -n : n;
			}else{
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}
	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {
			throw new NumberFormatException();
		}
		return (int) nl;
	}
	public char nextChar() {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		return (char) readByte();
	}
	public double nextDouble() { return Double.parseDouble(next());}
	public int[] nextIntArray(int n) { int[] a = new int[n]; for(int i=0;i<n;i++) a[i] = nextInt(); return a;}
	public long[] nextLongArray(int n) { long[] a = new long[n]; for(int i=0;i<n;i++) a[i] = nextLong(); return a;}
	public double[] nextDoubleArray(int n) { double[] a = new double[n]; for(int i=0;i<n;i++) a[i] = nextDouble(); return a;}
	public void nextIntArrays(int[]... a) { for(int i=0;i<a[0].length;i++) for(int j=0;j<a.length;j++) a[j][i] = nextInt();}
	public int[][] nextIntMatrix(int n,int m) { int[][] a = new int[n][]; for(int i=0;i<n;i++) a[i] = nextIntArray(m); return a;}
	public char[][] nextCharMap(int n,int m) { char[][] a = new char[n][]; for(int i=0;i<n;i++) a[i] = nextCharArray(m); return a;}
	public void close() { super.close(); try {in.close();} catch (IOException e) {}}
} IO private final InputStream in; in private final byte[] buffer = new byte[1024]; buffer new byte[1024] 1024 private int ptr = 0; ptr 0 private int buflen = 0; buflen 0 public IO() { this(System.in);} IO { this(System.in);} this(System.in) this System.in System System.in public IO(InputStream source) { super(System.out); this.in = source;} IO { super(System.out); this.in = source;} super(System.out) super System.out System System.out this.in = source this.in this this.in source InputStream source source private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		}else{
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	} hasNextByte {
		if (ptr < buflen) {
			return true;
		}else{
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	} if (ptr < buflen) {
			return true;
		}else{
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		} ptr < buflen ptr buflen {
			return true;
		} return true; true {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		} ptr = 0 ptr 0 try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			} catch (IOException e) {
				e.printStackTrace();
			} IOException e {
				e.printStackTrace();
			} e.printStackTrace() e.printStackTrace e {
				buflen = in.read(buffer);
			} buflen = in.read(buffer) buflen in.read(buffer) in.read in buffer if (buflen <= 0) {
				return false;
			} buflen <= 0 buflen 0 {
				return false;
			} return false; false return true; true private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;} readByte { if (hasNextByte()) return buffer[ptr++]; else return -1;} if (hasNextByte()) return buffer[ptr++]; else return -1; hasNextByte() hasNextByte return buffer[ptr++]; buffer[ptr++] buffer ptr++ ptr return -1; -1 1 private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;} isPrintableChar { return 33 <= c && c <= 126;} return 33 <= c && c <= 126; 33 <= c && c <= 126 33 <= c 33 c c <= 126 c 126 int c c private static boolean isNewLine(int c) { return c == '\n' || c == '\r';} isNewLine { return c == '\n' || c == '\r';} return c == '\n' || c == '\r'; c == '\n' || c == '\r' c == '\n' c '\n' c == '\r' c '\r' int c c public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();} hasNext { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();} while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; hasNextByte() && !isPrintableChar(buffer[ptr]) hasNextByte() hasNextByte !isPrintableChar(buffer[ptr]) isPrintableChar(buffer[ptr]) isPrintableChar buffer[ptr] buffer ptr ptr++ ptr return hasNextByte(); hasNextByte() hasNextByte public boolean hasNextLine() { while(hasNextByte() && isNewLine(buffer[ptr])) ptr++; return hasNextByte();} hasNextLine { while(hasNextByte() && isNewLine(buffer[ptr])) ptr++; return hasNextByte();} while(hasNextByte() && isNewLine(buffer[ptr])) ptr++; hasNextByte() && isNewLine(buffer[ptr]) hasNextByte() hasNextByte isNewLine(buffer[ptr]) isNewLine buffer[ptr] buffer ptr ptr++ ptr return hasNextByte(); hasNextByte() hasNextByte public String next() {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while(isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	} next {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while(isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	} if (!hasNext()) {
			throw new NoSuchElementException();
		} !hasNext() hasNext() hasNext {
			throw new NoSuchElementException();
		} throw new NoSuchElementException(); new NoSuchElementException() StringBuilder sb = new StringBuilder(); sb new StringBuilder() int b = readByte(); b readByte() readByte while(isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		} isPrintableChar(b) isPrintableChar b {
			sb.appendCodePoint(b);
			b = readByte();
		} sb.appendCodePoint(b) sb.appendCodePoint sb b b = readByte() b readByte() readByte return sb.toString(); sb.toString() sb.toString sb public char[] nextCharArray(int len) {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		char[] s = new char[len];
		int i = 0;
		int b = readByte();
		while(isPrintableChar(b)) {
			if (i == len) {
				throw new InputMismatchException();
			}
			s[i++] = (char) b;
			b = readByte();
		}
		return s;
	} nextCharArray {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		char[] s = new char[len];
		int i = 0;
		int b = readByte();
		while(isPrintableChar(b)) {
			if (i == len) {
				throw new InputMismatchException();
			}
			s[i++] = (char) b;
			b = readByte();
		}
		return s;
	} if (!hasNext()) {
			throw new NoSuchElementException();
		} !hasNext() hasNext() hasNext {
			throw new NoSuchElementException();
		} throw new NoSuchElementException(); new NoSuchElementException() char[] s = new char[len]; s new char[len] len int i = 0; i 0 int b = readByte(); b readByte() readByte while(isPrintableChar(b)) {
			if (i == len) {
				throw new InputMismatchException();
			}
			s[i++] = (char) b;
			b = readByte();
		} isPrintableChar(b) isPrintableChar b {
			if (i == len) {
				throw new InputMismatchException();
			}
			s[i++] = (char) b;
			b = readByte();
		} if (i == len) {
				throw new InputMismatchException();
			} i == len i len {
				throw new InputMismatchException();
			} throw new InputMismatchException(); new InputMismatchException() s[i++] = (char) b s[i++] s i++ i (char) b b = readByte() b readByte() readByte return s; s int len len public String nextLine() {
		if (!hasNextLine()) {
			throw new NoSuchElementException();
		}
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while(!isNewLine(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	} nextLine {
		if (!hasNextLine()) {
			throw new NoSuchElementException();
		}
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while(!isNewLine(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	} if (!hasNextLine()) {
			throw new NoSuchElementException();
		} !hasNextLine() hasNextLine() hasNextLine {
			throw new NoSuchElementException();
		} throw new NoSuchElementException(); new NoSuchElementException() StringBuilder sb = new StringBuilder(); sb new StringBuilder() int b = readByte(); b readByte() readByte while(!isNewLine(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		} !isNewLine(b) isNewLine(b) isNewLine b {
			sb.appendCodePoint(b);
			b = readByte();
		} sb.appendCodePoint(b) sb.appendCodePoint sb b b = readByte() b readByte() readByte return sb.toString(); sb.toString() sb.toString sb public long nextLong() {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			}else if(b == -1 || !isPrintableChar(b)){
				return minus ? -n : n;
			}else{
				throw new NumberFormatException();
			}
			b = readByte();
		}
	} nextLong {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			}else if(b == -1 || !isPrintableChar(b)){
				return minus ? -n : n;
			}else{
				throw new NumberFormatException();
			}
			b = readByte();
		}
	} if (!hasNext()) {
			throw new NoSuchElementException();
		} !hasNext() hasNext() hasNext {
			throw new NoSuchElementException();
		} throw new NoSuchElementException(); new NoSuchElementException() long n = 0; n 0 boolean minus = false; minus false int b = readByte(); b readByte() readByte if (b == '-') {
			minus = true;
			b = readByte();
		} b == '-' b '-' {
			minus = true;
			b = readByte();
		} minus = true minus true b = readByte() b readByte() readByte if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		} b < '0' || '9' < b b < '0' b '0' '9' < b '9' b {
			throw new NumberFormatException();
		} throw new NumberFormatException(); new NumberFormatException() while(true){
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			}else if(b == -1 || !isPrintableChar(b)){
				return minus ? -n : n;
			}else{
				throw new NumberFormatException();
			}
			b = readByte();
		} true {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			}else if(b == -1 || !isPrintableChar(b)){
				return minus ? -n : n;
			}else{
				throw new NumberFormatException();
			}
			b = readByte();
		} if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			}else if(b == -1 || !isPrintableChar(b)){
				return minus ? -n : n;
			}else{
				throw new NumberFormatException();
			} '0' <= b && b <= '9' '0' <= b '0' b b <= '9' b '9' {
				n *= 10;
				n += b - '0';
			} n *= 10 n 10 n += b - '0' n b - '0' b '0' if(b == -1 || !isPrintableChar(b)){
				return minus ? -n : n;
			}else{
				throw new NumberFormatException();
			} b == -1 || !isPrintableChar(b) b == -1 b -1 1 !isPrintableChar(b) isPrintableChar(b) isPrintableChar b {
				return minus ? -n : n;
			} return minus ? -n : n; minus ? -n : n minus -n n n {
				throw new NumberFormatException();
			} throw new NumberFormatException(); new NumberFormatException() b = readByte() b readByte() readByte public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {
			throw new NumberFormatException();
		}
		return (int) nl;
	} nextInt {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {
			throw new NumberFormatException();
		}
		return (int) nl;
	} long nl = nextLong(); nl nextLong() nextLong if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {
			throw new NumberFormatException();
		} nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE nl < Integer.MIN_VALUE nl Integer.MIN_VALUE Integer Integer.MIN_VALUE nl > Integer.MAX_VALUE nl Integer.MAX_VALUE Integer Integer.MAX_VALUE {
			throw new NumberFormatException();
		} throw new NumberFormatException(); new NumberFormatException() return (int) nl; (int) nl public char nextChar() {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		return (char) readByte();
	} nextChar {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		return (char) readByte();
	} if (!hasNext()) {
			throw new NoSuchElementException();
		} !hasNext() hasNext() hasNext {
			throw new NoSuchElementException();
		} throw new NoSuchElementException(); new NoSuchElementException() return (char) readByte(); (char) readByte() readByte public double nextDouble() { return Double.parseDouble(next());} nextDouble { return Double.parseDouble(next());} return Double.parseDouble(next()); Double.parseDouble(next()) Double.parseDouble Double next() next public int[] nextIntArray(int n) { int[] a = new int[n]; for(int i=0;i<n;i++) a[i] = nextInt(); return a;} nextIntArray { int[] a = new int[n]; for(int i=0;i<n;i++) a[i] = nextInt(); return a;} int[] a = new int[n]; a new int[n] n for(int i=0;i<n;i++) a[i] = nextInt(); int i=0; int i=0; i 0 i<n i n i++ i++ i a[i] = nextInt(); a[i] = nextInt() a[i] a i nextInt() nextInt return a; a int n n public long[] nextLongArray(int n) { long[] a = new long[n]; for(int i=0;i<n;i++) a[i] = nextLong(); return a;} nextLongArray { long[] a = new long[n]; for(int i=0;i<n;i++) a[i] = nextLong(); return a;} long[] a = new long[n]; a new long[n] n for(int i=0;i<n;i++) a[i] = nextLong(); int i=0; int i=0; i 0 i<n i n i++ i++ i a[i] = nextLong(); a[i] = nextLong() a[i] a i nextLong() nextLong return a; a int n n public double[] nextDoubleArray(int n) { double[] a = new double[n]; for(int i=0;i<n;i++) a[i] = nextDouble(); return a;} nextDoubleArray { double[] a = new double[n]; for(int i=0;i<n;i++) a[i] = nextDouble(); return a;} double[] a = new double[n]; a new double[n] n for(int i=0;i<n;i++) a[i] = nextDouble(); int i=0; int i=0; i 0 i<n i n i++ i++ i a[i] = nextDouble(); a[i] = nextDouble() a[i] a i nextDouble() nextDouble return a; a int n n public void nextIntArrays(int[]... a) { for(int i=0;i<a[0].length;i++) for(int j=0;j<a.length;j++) a[j][i] = nextInt();} nextIntArrays { for(int i=0;i<a[0].length;i++) for(int j=0;j<a.length;j++) a[j][i] = nextInt();} for(int i=0;i<a[0].length;i++) for(int j=0;j<a.length;j++) a[j][i] = nextInt(); int i=0; int i=0; i 0 i<a[0].length i a[0].length a[0] a 0 a[0].length i++ i++ i for(int j=0;j<a.length;j++) a[j][i] = nextInt(); for(int j=0;j<a.length;j++) a[j][i] = nextInt(); int j=0; int j=0; j 0 j<a.length j a.length a a.length j++ j++ j a[j][i] = nextInt(); a[j][i] = nextInt() a[j][i] a[j] a j i nextInt() nextInt int[]... a a public int[][] nextIntMatrix(int n,int m) { int[][] a = new int[n][]; for(int i=0;i<n;i++) a[i] = nextIntArray(m); return a;} nextIntMatrix { int[][] a = new int[n][]; for(int i=0;i<n;i++) a[i] = nextIntArray(m); return a;} int[][] a = new int[n][]; a new int[n][] n for(int i=0;i<n;i++) a[i] = nextIntArray(m); int i=0; int i=0; i 0 i<n i n i++ i++ i a[i] = nextIntArray(m); a[i] = nextIntArray(m) a[i] a i nextIntArray(m) nextIntArray m return a; a int n n int m m public char[][] nextCharMap(int n,int m) { char[][] a = new char[n][]; for(int i=0;i<n;i++) a[i] = nextCharArray(m); return a;} nextCharMap { char[][] a = new char[n][]; for(int i=0;i<n;i++) a[i] = nextCharArray(m); return a;} char[][] a = new char[n][]; a new char[n][] n for(int i=0;i<n;i++) a[i] = nextCharArray(m); int i=0; int i=0; i 0 i<n i n i++ i++ i a[i] = nextCharArray(m); a[i] = nextCharArray(m) a[i] a i nextCharArray(m) nextCharArray m return a; a int n n int m m public void close() { super.close(); try {in.close();} catch (IOException e) {}} close { super.close(); try {in.close();} catch (IOException e) {}} super.close() super.close super try {in.close();} catch (IOException e) {} catch (IOException e) {} IOException e {} {in.close();} in.close() in.close in PrintWriter public class Main {
	static final long C =  1000000007;
	static final int CY = 1000000000;
	static final int INF = Integer.MAX_VALUE/2;
	StringBuilder sb;
	//セット
	class Set<F,S> {
		F f;
		S s;
		Set(F f, S s) {this.f = f;this.s = s;}
	}
	int[][] G;
	//Map<Integer,List<Integer>> Genb = new HashMap<>();
	int V;
	int E;
	int Venb;
	int Eenb;
	long START_TIME;
	int GenbSize;//Genbグラフの1辺
	Random rand = new Random();
	int[][] DIR = new int[][]{{0,1},{1,0},{-1,0},{0,-1}};

	public void calc() {

		sb = new StringBuilder();


		//入力処理
		IO sc = new IO();

		int[][] map = new int[3][3];
		for (int i=0; i<3; i++) {
			for (int t=0;t < 3;t++) {
				map[i][t] = sc.nextInt();
			}
		}

		boolean ans = true;

		for (int i=0; i < 2; i++) {
			if (map[i][0] - map[i+1][0] == map[i][1] - map[i+1][1] &&
					map[i][2] - map[i+1][2] == map[i][1] - map[i+1][1]){}
			else ans = false;
		}




		System.out.println(ans?"Yes":"No");

	}
	boolean isIn(int y, int x,int h,int w) {
		return 0 <= y && y < h && 0 <= x && x < w;
	}


	public static void main(String[] args) {
		Main main = new Main();
		main.calc();

	}
} public class Main {
	static final long C =  1000000007;
	static final int CY = 1000000000;
	static final int INF = Integer.MAX_VALUE/2;
	StringBuilder sb;
	//セット
	class Set<F,S> {
		F f;
		S s;
		Set(F f, S s) {this.f = f;this.s = s;}
	}
	int[][] G;
	//Map<Integer,List<Integer>> Genb = new HashMap<>();
	int V;
	int E;
	int Venb;
	int Eenb;
	long START_TIME;
	int GenbSize;//Genbグラフの1辺
	Random rand = new Random();
	int[][] DIR = new int[][]{{0,1},{1,0},{-1,0},{0,-1}};

	public void calc() {

		sb = new StringBuilder();


		//入力処理
		IO sc = new IO();

		int[][] map = new int[3][3];
		for (int i=0; i<3; i++) {
			for (int t=0;t < 3;t++) {
				map[i][t] = sc.nextInt();
			}
		}

		boolean ans = true;

		for (int i=0; i < 2; i++) {
			if (map[i][0] - map[i+1][0] == map[i][1] - map[i+1][1] &&
					map[i][2] - map[i+1][2] == map[i][1] - map[i+1][1]){}
			else ans = false;
		}




		System.out.println(ans?"Yes":"No");

	}
	boolean isIn(int y, int x,int h,int w) {
		return 0 <= y && y < h && 0 <= x && x < w;
	}


	public static void main(String[] args) {
		Main main = new Main();
		main.calc();

	}
} Main
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.util.NoSuchElementException;
import java.util.Random;
public class Main {
	static final long C =  1000000007;
	static final int CY = 1000000000;
	static final int INF = Integer.MAX_VALUE/2;
	StringBuilder sb;
	//セット
	class Set<F,S> {
		F f;
		S s;
		Set(F f, S s) {this.f = f;this.s = s;}
	}
	int[][] G;
	//Map<Integer,List<Integer>> Genb = new HashMap<>();
	int V;
	int E;
	int Venb;
	int Eenb;
	long START_TIME;
	int GenbSize;//Genbグラフの1辺
	Random rand = new Random();
	int[][] DIR = new int[][]{{0,1},{1,0},{-1,0},{0,-1}};

	public void calc() {

		sb = new StringBuilder();


		//入力処理
		IO sc = new IO();

		int[][] map = new int[3][3];
		for (int i=0; i<3; i++) {
			for (int t=0;t < 3;t++) {
				map[i][t] = sc.nextInt();
			}
		}

		boolean ans = true;

		for (int i=0; i < 2; i++) {
			if (map[i][0] - map[i+1][0] == map[i][1] - map[i+1][1] &&
					map[i][2] - map[i+1][2] == map[i][1] - map[i+1][1]){}
			else ans = false;
		}




		System.out.println(ans?"Yes":"No");

	}
	boolean isIn(int y, int x,int h,int w) {
		return 0 <= y && y < h && 0 <= x && x < w;
	}


	public static void main(String[] args) {
		Main main = new Main();
		main.calc();

	}
}
class IO extends PrintWriter {
	private final InputStream in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	public IO() { this(System.in);}
	public IO(InputStream source) { super(System.out); this.in = source;}
	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		}else{
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}
	private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
	private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
	private static boolean isNewLine(int c) { return c == '\n' || c == '\r';}
	public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
	public boolean hasNextLine() { while(hasNextByte() && isNewLine(buffer[ptr])) ptr++; return hasNextByte();}
	public String next() {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while(isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	public char[] nextCharArray(int len) {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		char[] s = new char[len];
		int i = 0;
		int b = readByte();
		while(isPrintableChar(b)) {
			if (i == len) {
				throw new InputMismatchException();
			}
			s[i++] = (char) b;
			b = readByte();
		}
		return s;
	}
	public String nextLine() {
		if (!hasNextLine()) {
			throw new NoSuchElementException();
		}
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while(!isNewLine(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}
	public long nextLong() {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			}else if(b == -1 || !isPrintableChar(b)){
				return minus ? -n : n;
			}else{
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}
	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {
			throw new NumberFormatException();
		}
		return (int) nl;
	}
	public char nextChar() {
		if (!hasNext()) {
			throw new NoSuchElementException();
		}
		return (char) readByte();
	}
	public double nextDouble() { return Double.parseDouble(next());}
	public int[] nextIntArray(int n) { int[] a = new int[n]; for(int i=0;i<n;i++) a[i] = nextInt(); return a;}
	public long[] nextLongArray(int n) { long[] a = new long[n]; for(int i=0;i<n;i++) a[i] = nextLong(); return a;}
	public double[] nextDoubleArray(int n) { double[] a = new double[n]; for(int i=0;i<n;i++) a[i] = nextDouble(); return a;}
	public void nextIntArrays(int[]... a) { for(int i=0;i<a[0].length;i++) for(int j=0;j<a.length;j++) a[j][i] = nextInt();}
	public int[][] nextIntMatrix(int n,int m) { int[][] a = new int[n][]; for(int i=0;i<n;i++) a[i] = nextIntArray(m); return a;}
	public char[][] nextCharMap(int n,int m) { char[][] a = new char[n][]; for(int i=0;i<n;i++) a[i] = nextCharArray(m); return a;}
	public void close() { super.close(); try {in.close();} catch (IOException e) {}}
}