///In the name of Allah, the most Gracious and the most Merciful.
#include<bits/stdc++.h>
#define fr first
#define sc second
#define ll long long
#define pb push_back
#define no cout<<"NO"<<endl
#define yes cout<<"YES"<<endl
#define IShowSpeed ios_base::sync_with_stdio(0) ; cin.tie(0) ;
using namespace std ;

ll n , m , sum , k , c , z , x , y , d , a , b , cnt , ans , l , r ;
char arr[10][10] ;
multiset < ll > st , ts ;
map < pair < ll , ll > , bool > mp ;

bool check(ll h , ll q)
{
	if (h - 1 >= 0 and q - 1 >= 0 and arr[h - 1][q] == '#' and arr[h][q - 1] == '#')
		return false ;
	if (h - 1 >= 0 and q + 1 < 10 and arr[h - 1][q] == '#' and arr[h][q + 1] == '#')
		return false ;
	if (h + 1 < 10 and q - 1 >= 0 and arr[h + 1][q] == '#' and arr[h][q - 1] == '#')
		return false ;
	if (h + 1 < 10 and q + 1 < 10 and arr[h + 1][q] == '#' and arr[h][q + 1] == '#')
		return false ;
	return true ;
}

void zypl(ll h , ll w)
{
	cnt ++ ;
	mp[{h , w}] = true ;
	if (h + 1 < 10 and arr[h + 1][w] == '#')
		zypl(h + 1 , w) ;
	if (w + 1 < 10 and arr[h][w + 1] == '#')
		zypl(h , w + 1) ;
}

void mercurii()
{
    for (ll i = 0 ; i < 10 ; i ++ )
    {
    	for (ll j = 0 ; j < 10 ; j ++ )
    		cin >> arr[i][j] ;
	}
	for (ll i = 0 ; i < 10 ; i ++ )
	{
		for (ll j = 0 ; j < 10 ;  j ++ )
		{
			if (check(i , j) == false)
			{
			    no ;
				return ;
			}
		}
	}
	for (ll i = 0 ; i < 10 ; i ++ )
	{
		for (ll j = 0 ; j < 10 ; j ++ )
		{
			if (mp[{i , j}] == 0 and arr[i][j] == '#')
			{
				cnt = 0 ;
				zypl(i , j) ;
				// cout << i << " " << j << endl ;
				st.insert(cnt) ;
			}
		}
	}
	yes ;
}
/**
    So remember me , I will remember you [ Quran 2:152 ]
**/
int main()
{
    IShowSpeed
    ll t = 1 ;
    ///cin >> t ;
    while ( t -- )
    {
        mercurii() ;
    }
}
