import java.util.Scanner;
public class Test01 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int[][] arr = new int[9][9];
boolean check;
while (sc.hasNextInt()) {
check = true;
for (int i = 0; i < 9; i++) {
for (int j = 0; j < 9; j++) {
arr[i][j] = sc.nextInt();
}
}
for (int i = 0; i < 9; i++) {
int sum = 0;
for (int j = 0; j < 9; j++) {
sum += arr[i][j];
sum += arr[j][i];
}
if (sum != 90) {
check = false;
break;
}
}
ea:
if (check) {
for (int i = 0; i < 9; i += 3) {
for (int j = 0; j < 9; j += 3) {
int sum = 0;
for (int x = 0; x < 3; x++) {
for (int y = 0; y < 3; y++) {
sum += arr[i + x][j + y];
}
}
if (sum != 45) {
check = false;
break ea;
}
}
}
}
if(check){
System.out.println("yes");
}else{
System.out.println("no");
}
}
}
}