/*
   (( '-""``""-' ))
     )-__-_.._-__-(
   / --- (o _ o) --- \
   \ .-* ( .0. ) *-. /
   _'-. ,_ '=' _, .-'_
  / ;#'#'# - #'#'#; \
 \_)) -----'#'----- ((_/
      # --------- #
      '# ------- #'
  /..-'# ------- #'-.\
  _\...-\'# -- #'/-.../_
  ((____)- '#' -(____))
    art by - Vinni01 / luchi abi
 
    cout << fixed << setprecision(6) << x;
    freopen ( "sum.in", "r", stdin )
*/
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <fstream>
#include <unordered_map>
using namespace std ;
#define ll int
#define ff first
#define ss second
#define pb push_back 
#define pf push_front
#define UseOFF ios_base::sync_with_stdio(0);cin.tie(0), cout.tie(0);
#define sz size
#define ins insert
#define new jweijofdg
const ll N = 111 ;
const ll k = 400 ;
ll p[ N ] ;
ll timer ;
ll tin[ N ] ;
ll t[ N + N + N + N ] ; 
ll cnt[ N ] ;
char a[ N ][ N ] ;
bool b = 0 ;
ll ok = 0 ;
bool used[ N ][ N ] ;
ll X = 0, Y = 0 ;
bool alr = 0 ;
void check1( ll x, ll y, ll kk )
{
 if( kk == 0 )
 {
  alr = 1 ;
  ok++ ;
  while( x != X )
  {
   used[ x ][ y ] = 1 ;
   used[ x + 1 ][ y ] = 1 ;
   used[ x - 1 ][ y ] = 1 ;
   used[ x ][ y - 1 ] = 1 ;
   used[ x ][ y + 1 ] = 1 ;
   used[ x + 1 ][ y + 1 ] = 1 ;
   used[ x + 1 ][ y - 1 ] = 1 ;
   used[ x - 1 ][ y + 1 ] = 1 ;
   used[ x - 1 ][ y - 1 ] = 1 ;
   x-- ;
  }
  return ;
 }
 if( x + 1 <= 10 && a[ x + 1 ][ y ] == '#' ) check1( x + 1, y, kk - 1 ) ;
 return ;
}
void check2( ll x, ll y, ll kk )
{
 if( kk == 0 )
 {
  alr = 1 ;
  ok++ ;
  while( y != Y )
  {
   used[ x ][ y ] = 1 ;
   used[ x + 1 ][ y ] = 1 ;
   used[ x - 1 ][ y ] = 1 ;
   used[ x ][ y - 1 ] = 1 ;
   used[ x ][ y + 1 ] = 1 ;
   used[ x + 1 ][ y + 1 ] = 1 ;
   used[ x + 1 ][ y - 1 ] = 1 ;
   used[ x - 1 ][ y + 1 ] = 1 ;
   used[ x - 1 ][ y - 1 ] = 1 ;
   y-- ;
  }
  return ;
 }
 if( y + 1 <= 10 && a[ x ][ y + 1 ] == '#' ) check2( x, y + 1, kk - 1 ) ;
 return ;
}
signed main()
{
 UseOFF
 ll n = 10 ;
 for( int i = 1 ; i <= n ; i++ )
 {
  for( int j = 1 ; j <= n ; j++ )
  {
   cin >> a[ i ][ j ] ;
  }
 }
 bool flag = 0 ;
 for( int i = 1 ; i <= n ; i++ ) // 4x ;
 {
  for( int j = 1 ; j <= n ; j++ )
  {
   if( a[ i ][ j ] == '#' ) 
   {
    X = i, Y = j ;
    check1( i, j, 3 ) ;
    if( ok == 1 ) { flag = 1 ; break ; }
    if( alr == 0 ) check2( i, j, 3 ) ;
    if( ok == 1 ) { flag = 1 ; break ; }
    alr = 0 ;
   }
  }
  if( flag ) break ;
 }
 if( ok < 1 )
 {
  cout << "NO" ;
  return 0 ;
 }
 ok = 0, flag = 0 ;
 for( int i = 1 ; i <= n ; i++ ) // 3x ;
 {
  for( int j = 1 ; j <= n ; j++ )
  {
   if( a[ i ][ j ] == '#' && !used[ i ][ j ] ) 
   {
    X = i, Y = j ;
    check1( i, j, 2 ) ;
    if( ok == 2 ) { flag = 1 ; break ; }
    if( alr == 0 ) check2( i, j, 2 ) ;
    if( ok == 2 ) { flag = 1 ; break ; }
    alr = 0 ;
   }
  }
  if( flag ) break ;
 }
 if( ok < 2 )
 {
  cout << "NO" ;
  return 0 ;
 }
 ok = 0, flag = 0 ;
 for( int i = 1 ; i <= n ; i++ ) // 2x ;
 {
  for( int j = 1 ; j <= n ; j++ )
  {
   if( a[ i ][ j ] == '#' && !used[ i ][ j ] ) 
   {
    X = i, Y = j ;
    check1( i, j, 1 ) ;
    if( ok == 3 ) { flag = 1 ; break ; }
    if( alr == 0 ) check2( i, j, 1 ) ;
    if( ok == 3 ) { flag = 1 ; break ; }
    alr = 0 ;
   }
  }
  if( flag ) break ;
 }
 if( ok < 3 )
 {
  cout << "NO" ;
  return 0 ;
 }
 ok = 0, flag = 0 ;
 for( int i = 1 ; i <= n ; i++ ) // 2x ;
 {
  for( int j = 1 ; j <= n ; j++ )
  {
   if( a[ i ][ j ] == '#' && !used[ i ][ j ] ) 
   {
    X = i, Y = j ;
    check1( i, j, 0 ) ;
    if( ok == 4 ) { flag = 1 ; break ; }
    if( alr == 0 ) check2( i, j, 0 ) ;
    if( ok == 4 ) { flag = 1 ; break ; }
    alr = 0 ;
   }
   //cout << '\n' ;
  }
  if( flag ) break ;
 }
 //cout << ok << '\n' ;
 if( ok < 4 )
 {
  cout << "NO" ;
  return 0
