//============================================================================
// Author      : Bissenov Anuar
//============================================================================
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define run_faster ios::sync_with_stdio (false); cin.tie (0); cout.tie (0); ios_base::sync_with_stdio(0); cin.tie(nullptr);
#define F first
#define S second
#define emb emplace_back
#define pii pair<int,int>
#define all(v) (v.begin(),v.end())
#define rall(v) (v.rbegin(),v.rend())
using namespace std;

int dx[] = {0,0,-1,+1};
int dy[] = {-1,+1,0,0};

bool was[10][10];

int cnt1, cnt2, cnt3, cnt4;
bool joi = 1;

string s[10];
void bfs( int sx, int sy ) {
	queue<pair<int,int>> q;
	q.push({sx,sy});
	was[sx][sy] = 1;
	int cur_l = 1;
	while( !q.empty() ) {
		auto [x,y] = q.front();
		q.pop();
		for( int i = 0; i < 4; i++ ) {
			int ux = x+dx[i];
			int uy = y+dy[i];
			if( ux >= 0 && uy >= 0 && ux < 10 && uy < 10 ) {
				if( s[ux][uy] == '#' && !was[ux][uy] ) {
					q.push({ux,uy});
					was[ux][uy] = 1;
					cur_l++;
				}
			}
			for( int i = 2; i < 4; i++ ) {
				int ux = x+dx[i];
				for( int j = 0; j < 2; j++ ) {
					int uy = y+dy[j];
					if( ux >= 0 && uy >= 0 && ux < 10 && uy < 10 ) {
						if( s[ux][uy] == '#') {
							joi = 0;
							break;
						}
					}
				}
			}
		}
	}
	if( !joi ) {
		return;
	}
	switch( cur_l ) {
		case 1:
			cnt1++;
			break;
		case 2:
			cnt2++;
			break;
		case 3:
			cnt3++;
			break;
		case 4:
			cnt4++;
			break;
		default:
			joi = 0;
			break;
	}
}

signed main()
{
    run_faster;
//	#ifndef ONLINE_JUDGE
//        freopen( "inverse.in" , "r" , stdin );
//        freopen( "inverse.out" , "w" , stdout );
//	#endif

    for( int i = 0; i < 10; i++ ) {
    	cin >> s[i];
    }
    for( int i = 0; i < 10; i++ ) {
    	for( int j = 0; j < 10; j++ ) {
    		if( s[i][j] == '#' && !was[i][j] ) {
    			bfs(i,j);
    			if( !joi ) {
    				cout << "NO";
    				return 0;
    			}
    		}
    	}
    }
    if( cnt1 != 4 || cnt2 != 3 || cnt3 != 2 || cnt4 != 1 ) {
    	cout << "NO";
    } else {
    	cout << "YES\n";
    }

    return 0;
} 
