import java.util.Scanner;

public class Main{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	int[][] c_ = new int[3][3];
	for(int i = 0; i < 3; i++){
	    for(int j = 0; j < 3; j++){
		c_[i][j] = scan.nextInt();
	    }
	}
	int one_max = Integer.MIN_VALUE;
	int two_max = Integer.MIN_VALUE;
	int three_max = Integer.MIN_VALUE;
	for(int i = 0; i < 3; i++){
	    for(int j = 0; j < 3; j++){
		if(i == 0){
		    if(c_[j][i] > one_max)
			one_max = c_[j][i];
		}else if(i == 1){
		    if(c_[j][i] > two_max)
			two_max = c_[j][i];
		}else{
		    if(c_[j][i] > three_max)
			three_max = c_[j][i];
		}
	    }
	}
	
	int[][] a_ = new int[3][3];
	int[][] b_ = new int[3][3];
	boolean[] flag_ = {false, false, false};
	for(int one = 0; one <= one_max; one++){
	    for(int two = 0; two <= two_max; two++){
		for(int three = 0; three <= three_max; three++){
		    flag_[0] = false;
		    flag_[1] = false;
		    flag_[2] = false;
		    for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			}
			if(a_[i][0] == a_[i][1] &&
			   a_[i][0] == a_[i][2]){
			    flag_[i] = true;
			}else{
			}
		    }
		}
	    }
	}

	if(flag_[0] == true &&
	   flag_[1] == true &&
	   flag_[2] == true){
	    System.out.println("Yes");
	}else{
	    System.out.println("No");
	}
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	int[][] c_ = new int[3][3];
	for(int i = 0; i < 3; i++){
	    for(int j = 0; j < 3; j++){
		c_[i][j] = scan.nextInt();
	    }
	}
	int one_max = Integer.MIN_VALUE;
	int two_max = Integer.MIN_VALUE;
	int three_max = Integer.MIN_VALUE;
	for(int i = 0; i < 3; i++){
	    for(int j = 0; j < 3; j++){
		if(i == 0){
		    if(c_[j][i] > one_max)
			one_max = c_[j][i];
		}else if(i == 1){
		    if(c_[j][i] > two_max)
			two_max = c_[j][i];
		}else{
		    if(c_[j][i] > three_max)
			three_max = c_[j][i];
		}
	    }
	}
	
	int[][] a_ = new int[3][3];
	int[][] b_ = new int[3][3];
	boolean[] flag_ = {false, false, false};
	for(int one = 0; one <= one_max; one++){
	    for(int two = 0; two <= two_max; two++){
		for(int three = 0; three <= three_max; three++){
		    flag_[0] = false;
		    flag_[1] = false;
		    flag_[2] = false;
		    for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			}
			if(a_[i][0] == a_[i][1] &&
			   a_[i][0] == a_[i][2]){
			    flag_[i] = true;
			}else{
			}
		    }
		}
	    }
	}

	if(flag_[0] == true &&
	   flag_[1] == true &&
	   flag_[2] == true){
	    System.out.println("Yes");
	}else{
	    System.out.println("No");
	}
    }
} Main public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	int[][] c_ = new int[3][3];
	for(int i = 0; i < 3; i++){
	    for(int j = 0; j < 3; j++){
		c_[i][j] = scan.nextInt();
	    }
	}
	int one_max = Integer.MIN_VALUE;
	int two_max = Integer.MIN_VALUE;
	int three_max = Integer.MIN_VALUE;
	for(int i = 0; i < 3; i++){
	    for(int j = 0; j < 3; j++){
		if(i == 0){
		    if(c_[j][i] > one_max)
			one_max = c_[j][i];
		}else if(i == 1){
		    if(c_[j][i] > two_max)
			two_max = c_[j][i];
		}else{
		    if(c_[j][i] > three_max)
			three_max = c_[j][i];
		}
	    }
	}
	
	int[][] a_ = new int[3][3];
	int[][] b_ = new int[3][3];
	boolean[] flag_ = {false, false, false};
	for(int one = 0; one <= one_max; one++){
	    for(int two = 0; two <= two_max; two++){
		for(int three = 0; three <= three_max; three++){
		    flag_[0] = false;
		    flag_[1] = false;
		    flag_[2] = false;
		    for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			}
			if(a_[i][0] == a_[i][1] &&
			   a_[i][0] == a_[i][2]){
			    flag_[i] = true;
			}else{
			}
		    }
		}
	    }
	}

	if(flag_[0] == true &&
	   flag_[1] == true &&
	   flag_[2] == true){
	    System.out.println("Yes");
	}else{
	    System.out.println("No");
	}
    } main {
	Scanner scan = new Scanner(System.in);

	int[][] c_ = new int[3][3];
	for(int i = 0; i < 3; i++){
	    for(int j = 0; j < 3; j++){
		c_[i][j] = scan.nextInt();
	    }
	}
	int one_max = Integer.MIN_VALUE;
	int two_max = Integer.MIN_VALUE;
	int three_max = Integer.MIN_VALUE;
	for(int i = 0; i < 3; i++){
	    for(int j = 0; j < 3; j++){
		if(i == 0){
		    if(c_[j][i] > one_max)
			one_max = c_[j][i];
		}else if(i == 1){
		    if(c_[j][i] > two_max)
			two_max = c_[j][i];
		}else{
		    if(c_[j][i] > three_max)
			three_max = c_[j][i];
		}
	    }
	}
	
	int[][] a_ = new int[3][3];
	int[][] b_ = new int[3][3];
	boolean[] flag_ = {false, false, false};
	for(int one = 0; one <= one_max; one++){
	    for(int two = 0; two <= two_max; two++){
		for(int three = 0; three <= three_max; three++){
		    flag_[0] = false;
		    flag_[1] = false;
		    flag_[2] = false;
		    for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			}
			if(a_[i][0] == a_[i][1] &&
			   a_[i][0] == a_[i][2]){
			    flag_[i] = true;
			}else{
			}
		    }
		}
	    }
	}

	if(flag_[0] == true &&
	   flag_[1] == true &&
	   flag_[2] == true){
	    System.out.println("Yes");
	}else{
	    System.out.println("No");
	}
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int[][] c_ = new int[3][3]; c_ new int[3][3] 3 3 for(int i = 0; i < 3; i++){
	    for(int j = 0; j < 3; j++){
		c_[i][j] = scan.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] = scan.nextInt();
	    }
	} {
	    for(int j = 0; j < 3; j++){
		c_[i][j] = scan.nextInt();
	    }
	} for(int j = 0; j < 3; j++){
		c_[i][j] = scan.nextInt();
	    } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
		c_[i][j] = scan.nextInt();
	    } {
		c_[i][j] = scan.nextInt();
	    } c_[i][j] = scan.nextInt() c_[i][j] c_[i] c_ i j scan.nextInt() scan.nextInt scan int one_max = Integer.MIN_VALUE; one_max Integer.MIN_VALUE Integer Integer.MIN_VALUE int two_max = Integer.MIN_VALUE; two_max Integer.MIN_VALUE Integer Integer.MIN_VALUE int three_max = Integer.MIN_VALUE; three_max Integer.MIN_VALUE Integer Integer.MIN_VALUE for(int i = 0; i < 3; i++){
	    for(int j = 0; j < 3; j++){
		if(i == 0){
		    if(c_[j][i] > one_max)
			one_max = c_[j][i];
		}else if(i == 1){
		    if(c_[j][i] > two_max)
			two_max = c_[j][i];
		}else{
		    if(c_[j][i] > three_max)
			three_max = c_[j][i];
		}
	    }
	} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
	    for(int j = 0; j < 3; j++){
		if(i == 0){
		    if(c_[j][i] > one_max)
			one_max = c_[j][i];
		}else if(i == 1){
		    if(c_[j][i] > two_max)
			two_max = c_[j][i];
		}else{
		    if(c_[j][i] > three_max)
			three_max = c_[j][i];
		}
	    }
	} {
	    for(int j = 0; j < 3; j++){
		if(i == 0){
		    if(c_[j][i] > one_max)
			one_max = c_[j][i];
		}else if(i == 1){
		    if(c_[j][i] > two_max)
			two_max = c_[j][i];
		}else{
		    if(c_[j][i] > three_max)
			three_max = c_[j][i];
		}
	    }
	} for(int j = 0; j < 3; j++){
		if(i == 0){
		    if(c_[j][i] > one_max)
			one_max = c_[j][i];
		}else if(i == 1){
		    if(c_[j][i] > two_max)
			two_max = c_[j][i];
		}else{
		    if(c_[j][i] > three_max)
			three_max = c_[j][i];
		}
	    } int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
		if(i == 0){
		    if(c_[j][i] > one_max)
			one_max = c_[j][i];
		}else if(i == 1){
		    if(c_[j][i] > two_max)
			two_max = c_[j][i];
		}else{
		    if(c_[j][i] > three_max)
			three_max = c_[j][i];
		}
	    } {
		if(i == 0){
		    if(c_[j][i] > one_max)
			one_max = c_[j][i];
		}else if(i == 1){
		    if(c_[j][i] > two_max)
			two_max = c_[j][i];
		}else{
		    if(c_[j][i] > three_max)
			three_max = c_[j][i];
		}
	    } if(i == 0){
		    if(c_[j][i] > one_max)
			one_max = c_[j][i];
		}else if(i == 1){
		    if(c_[j][i] > two_max)
			two_max = c_[j][i];
		}else{
		    if(c_[j][i] > three_max)
			three_max = c_[j][i];
		} i == 0 i 0 {
		    if(c_[j][i] > one_max)
			one_max = c_[j][i];
		} if(c_[j][i] > one_max)
			one_max = c_[j][i]; c_[j][i] > one_max c_[j][i] c_[j] c_ j i one_max one_max = c_[j][i] one_max c_[j][i] c_[j] c_ j i if(i == 1){
		    if(c_[j][i] > two_max)
			two_max = c_[j][i];
		}else{
		    if(c_[j][i] > three_max)
			three_max = c_[j][i];
		} i == 1 i 1 {
		    if(c_[j][i] > two_max)
			two_max = c_[j][i];
		} if(c_[j][i] > two_max)
			two_max = c_[j][i]; c_[j][i] > two_max c_[j][i] c_[j] c_ j i two_max two_max = c_[j][i] two_max c_[j][i] c_[j] c_ j i {
		    if(c_[j][i] > three_max)
			three_max = c_[j][i];
		} if(c_[j][i] > three_max)
			three_max = c_[j][i]; c_[j][i] > three_max c_[j][i] c_[j] c_ j i three_max three_max = c_[j][i] three_max c_[j][i] c_[j] c_ j i int[][] a_ = new int[3][3]; a_ new int[3][3] 3 3 int[][] b_ = new int[3][3]; b_ new int[3][3] 3 3 boolean[] flag_ = {false, false, false}; flag_ {false, false, false} false false false for(int one = 0; one <= one_max; one++){
	    for(int two = 0; two <= two_max; two++){
		for(int three = 0; three <= three_max; three++){
		    flag_[0] = false;
		    flag_[1] = false;
		    flag_[2] = false;
		    for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			}
			if(a_[i][0] == a_[i][1] &&
			   a_[i][0] == a_[i][2]){
			    flag_[i] = true;
			}else{
			}
		    }
		}
	    }
	} int one = 0; int one = 0; one 0 one <= one_max one one_max one++ one++ one {
	    for(int two = 0; two <= two_max; two++){
		for(int three = 0; three <= three_max; three++){
		    flag_[0] = false;
		    flag_[1] = false;
		    flag_[2] = false;
		    for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			}
			if(a_[i][0] == a_[i][1] &&
			   a_[i][0] == a_[i][2]){
			    flag_[i] = true;
			}else{
			}
		    }
		}
	    }
	} {
	    for(int two = 0; two <= two_max; two++){
		for(int three = 0; three <= three_max; three++){
		    flag_[0] = false;
		    flag_[1] = false;
		    flag_[2] = false;
		    for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			}
			if(a_[i][0] == a_[i][1] &&
			   a_[i][0] == a_[i][2]){
			    flag_[i] = true;
			}else{
			}
		    }
		}
	    }
	} for(int two = 0; two <= two_max; two++){
		for(int three = 0; three <= three_max; three++){
		    flag_[0] = false;
		    flag_[1] = false;
		    flag_[2] = false;
		    for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			}
			if(a_[i][0] == a_[i][1] &&
			   a_[i][0] == a_[i][2]){
			    flag_[i] = true;
			}else{
			}
		    }
		}
	    } int two = 0; int two = 0; two 0 two <= two_max two two_max two++ two++ two {
		for(int three = 0; three <= three_max; three++){
		    flag_[0] = false;
		    flag_[1] = false;
		    flag_[2] = false;
		    for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			}
			if(a_[i][0] == a_[i][1] &&
			   a_[i][0] == a_[i][2]){
			    flag_[i] = true;
			}else{
			}
		    }
		}
	    } {
		for(int three = 0; three <= three_max; three++){
		    flag_[0] = false;
		    flag_[1] = false;
		    flag_[2] = false;
		    for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			}
			if(a_[i][0] == a_[i][1] &&
			   a_[i][0] == a_[i][2]){
			    flag_[i] = true;
			}else{
			}
		    }
		}
	    } for(int three = 0; three <= three_max; three++){
		    flag_[0] = false;
		    flag_[1] = false;
		    flag_[2] = false;
		    for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			}
			if(a_[i][0] == a_[i][1] &&
			   a_[i][0] == a_[i][2]){
			    flag_[i] = true;
			}else{
			}
		    }
		} int three = 0; int three = 0; three 0 three <= three_max three three_max three++ three++ three {
		    flag_[0] = false;
		    flag_[1] = false;
		    flag_[2] = false;
		    for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			}
			if(a_[i][0] == a_[i][1] &&
			   a_[i][0] == a_[i][2]){
			    flag_[i] = true;
			}else{
			}
		    }
		} {
		    flag_[0] = false;
		    flag_[1] = false;
		    flag_[2] = false;
		    for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			}
			if(a_[i][0] == a_[i][1] &&
			   a_[i][0] == a_[i][2]){
			    flag_[i] = true;
			}else{
			}
		    }
		} flag_[0] = false flag_[0] flag_ 0 false flag_[1] = false flag_[1] flag_ 1 false flag_[2] = false flag_[2] flag_ 2 false for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			}
			if(a_[i][0] == a_[i][1] &&
			   a_[i][0] == a_[i][2]){
			    flag_[i] = true;
			}else{
			}
		    } int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			for(int j = 0; j < 3; j++){
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			}
			if(a_[i][0] == a_[i][1] &&
			   a_[i][0] == a_[i][2]){
			    flag_[i] = true;
			}else{
			}
		    } {
			for(int j = 0; j < 3; j++){
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			}
			if(a_[i][0] == a_[i][1] &&
			   a_[i][0] == a_[i][2]){
			    flag_[i] = true;
			}else{
			}
		    } for(int j = 0; j < 3; j++){
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			} int j = 0; int j = 0; j 0 j < 3 j 3 j++ j++ j {
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			} {
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			} switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    } j case 0 : 0 case 0 : b_[i][j] = one b_[i][j] b_[i] b_ i j one break; case 1: 1 case 1: b_[i][j] = two b_[i][j] b_[i] b_ i j two break; case 2: 2 case 2: b_[i][j] = three b_[i][j] b_[i] b_ i j three break; a_[i][j] = c_[i][j] - b_[i][j] a_[i][j] a_[i] a_ i j c_[i][j] - b_[i][j] c_[i][j] c_[i] c_ i j b_[i][j] b_[i] b_ i j if(a_[i][0] == a_[i][1] &&
			   a_[i][0] == a_[i][2]){
			    flag_[i] = true;
			}else{
			} a_[i][0] == a_[i][1] &&
			   a_[i][0] == a_[i][2] a_[i][0] == a_[i][1] a_[i][0] a_[i] a_ i 0 a_[i][1] a_[i] a_ i 1 a_[i][0] == a_[i][2] a_[i][0] a_[i] a_ i 0 a_[i][2] a_[i] a_ i 2 {
			    flag_[i] = true;
			} flag_[i] = true flag_[i] flag_ i true {
			} if(flag_[0] == true &&
	   flag_[1] == true &&
	   flag_[2] == true){
	    System.out.println("Yes");
	}else{
	    System.out.println("No");
	} flag_[0] == true &&
	   flag_[1] == true &&
	   flag_[2] == true flag_[0] == true &&
	   flag_[1] == true &&
	   flag_[2] == true flag_[0] == true flag_[0] flag_ 0 true flag_[1] == true flag_[1] flag_ 1 true flag_[2] == true flag_[2] flag_ 2 true {
	    System.out.println("Yes");
	} System.out.println("Yes") System.out.println System.out System System.out "Yes" {
	    System.out.println("No");
	} 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 scan = new Scanner(System.in);

	int[][] c_ = new int[3][3];
	for(int i = 0; i < 3; i++){
	    for(int j = 0; j < 3; j++){
		c_[i][j] = scan.nextInt();
	    }
	}
	int one_max = Integer.MIN_VALUE;
	int two_max = Integer.MIN_VALUE;
	int three_max = Integer.MIN_VALUE;
	for(int i = 0; i < 3; i++){
	    for(int j = 0; j < 3; j++){
		if(i == 0){
		    if(c_[j][i] > one_max)
			one_max = c_[j][i];
		}else if(i == 1){
		    if(c_[j][i] > two_max)
			two_max = c_[j][i];
		}else{
		    if(c_[j][i] > three_max)
			three_max = c_[j][i];
		}
	    }
	}
	
	int[][] a_ = new int[3][3];
	int[][] b_ = new int[3][3];
	boolean[] flag_ = {false, false, false};
	for(int one = 0; one <= one_max; one++){
	    for(int two = 0; two <= two_max; two++){
		for(int three = 0; three <= three_max; three++){
		    flag_[0] = false;
		    flag_[1] = false;
		    flag_[2] = false;
		    for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			}
			if(a_[i][0] == a_[i][1] &&
			   a_[i][0] == a_[i][2]){
			    flag_[i] = true;
			}else{
			}
		    }
		}
	    }
	}

	if(flag_[0] == true &&
	   flag_[1] == true &&
	   flag_[2] == true){
	    System.out.println("Yes");
	}else{
	    System.out.println("No");
	}
    }
} public class Main{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	int[][] c_ = new int[3][3];
	for(int i = 0; i < 3; i++){
	    for(int j = 0; j < 3; j++){
		c_[i][j] = scan.nextInt();
	    }
	}
	int one_max = Integer.MIN_VALUE;
	int two_max = Integer.MIN_VALUE;
	int three_max = Integer.MIN_VALUE;
	for(int i = 0; i < 3; i++){
	    for(int j = 0; j < 3; j++){
		if(i == 0){
		    if(c_[j][i] > one_max)
			one_max = c_[j][i];
		}else if(i == 1){
		    if(c_[j][i] > two_max)
			two_max = c_[j][i];
		}else{
		    if(c_[j][i] > three_max)
			three_max = c_[j][i];
		}
	    }
	}
	
	int[][] a_ = new int[3][3];
	int[][] b_ = new int[3][3];
	boolean[] flag_ = {false, false, false};
	for(int one = 0; one <= one_max; one++){
	    for(int two = 0; two <= two_max; two++){
		for(int three = 0; three <= three_max; three++){
		    flag_[0] = false;
		    flag_[1] = false;
		    flag_[2] = false;
		    for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			}
			if(a_[i][0] == a_[i][1] &&
			   a_[i][0] == a_[i][2]){
			    flag_[i] = true;
			}else{
			}
		    }
		}
	    }
	}

	if(flag_[0] == true &&
	   flag_[1] == true &&
	   flag_[2] == true){
	    System.out.println("Yes");
	}else{
	    System.out.println("No");
	}
    }
} Main
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	int[][] c_ = new int[3][3];
	for(int i = 0; i < 3; i++){
	    for(int j = 0; j < 3; j++){
		c_[i][j] = scan.nextInt();
	    }
	}
	int one_max = Integer.MIN_VALUE;
	int two_max = Integer.MIN_VALUE;
	int three_max = Integer.MIN_VALUE;
	for(int i = 0; i < 3; i++){
	    for(int j = 0; j < 3; j++){
		if(i == 0){
		    if(c_[j][i] > one_max)
			one_max = c_[j][i];
		}else if(i == 1){
		    if(c_[j][i] > two_max)
			two_max = c_[j][i];
		}else{
		    if(c_[j][i] > three_max)
			three_max = c_[j][i];
		}
	    }
	}
	
	int[][] a_ = new int[3][3];
	int[][] b_ = new int[3][3];
	boolean[] flag_ = {false, false, false};
	for(int one = 0; one <= one_max; one++){
	    for(int two = 0; two <= two_max; two++){
		for(int three = 0; three <= three_max; three++){
		    flag_[0] = false;
		    flag_[1] = false;
		    flag_[2] = false;
		    for(int i = 0; i < 3; i++){
			for(int j = 0; j < 3; j++){
			    switch(j){
			    case 0 :
				b_[i][j] = one;
				break;
			    case 1:
				b_[i][j] = two;
				break;
			    case 2:
				b_[i][j] = three;
				break;
			    }
			    a_[i][j] = c_[i][j] - b_[i][j];
			}
			if(a_[i][0] == a_[i][1] &&
			   a_[i][0] == a_[i][2]){
			    flag_[i] = true;
			}else{
			}
		    }
		}
	    }
	}

	if(flag_[0] == true &&
	   flag_[1] == true &&
	   flag_[2] == true){
	    System.out.println("Yes");
	}else{
	    System.out.println("No");
	}
    }
}
