#include <iostream>
using namespace std;
int main()
{
   int n = 10 ;
   cin >> n ;
   int a[n][n] ;
   for ( int i = 0 ; i < n ; i++) {
       for ( int j = 0 ; j < n ; j++){
           cin >> a[i][j] ;
       }
   }
   for ( int i = 0 ; i < n ; i++) {
       for ( int j = 0 ; j < n ; j++){
           if ( a[i][j] == a[n][n-1]) 
   cout << "NO"; 
   else if (a[i][j] == a[n][n+1] ) 
   cout << "NO" ;
   else if ( a[i][j] == a[n-1][n-1]) 
   cout << "NO";
   else if ( a[i][j] == a[n-1][n])
   cout<< "NO";
   else if ( a[i][j] == a[n-1][n+1])
   cout << "NO" ;
   else if ( a[i][j] == a[n+1][n-1])
   cout << "NO";
   else if ( a[i][j] == a[n+1][n])
   cout << "NO";
   else if ( a[i][j] ==a[n+1][n+1])
   cout << "NO" ;
   else 
   cout << "YES";      
   }
   }
}