#include <bits/stdc++.h>
using namespace std;

char a[12][12];
bool was[12][12];
int cnt[5];

int dx, dy;

bool flag;

bool ok(int i, int j){
	return 1 <= i and i <= 10 and 1 <= j and j <= 10 and a[i][j] == '#';
}

void dfs(int x, int y) {
	was[x][y] = true;
	
	for (int i = -1; i <= 1; ++i) {
		for (int j = -1; j <= 1; ++j) {
			if (ok(x + i, y + j) and !was[x + i][y + j]) {
				if (i != 0 and j != 0) {
					flag = true;
					return;
				}
				dfs(x + i, y + j); 
				if(i != 0) dx++;
				if(j != 0) dy++;
			}
		}
	}
	
	if(dx != 0 and dy != 0){
		flag = true;
		return;
	}
	if(dx != 0){
		if(dx + 1 > 4){
			flag = true;
		}
		else cnt[dx + 1]++;
	}
	else{
		if(dy + 1 > 4){
			flag = true;
		}
		else cnt[dy + 1]++;
	}
}

void solve() {
	for (int i = 1; i <= 10; ++i) {
        for (int j = 1; j <= 10; ++j) {
            cin >> a[i][j];
        }
	}
	
	for (int i = 1; i <= 10; ++i) {
        for (int j = 1; j <= 10; ++j) {
            if (a[i][j] == '#' and !was[i][j])
            dfs(i, j);
            dx = 0; dy = 0;
            
            if(flag){
            	cout << "NO";
            	return;
			}
        }
	}
	
	if(flag){
        cout << "NO";
        return;
	}
	if(cnt[1] != 4 or cnt[2] != 3 or cnt[3] != 2 or cnt[4] != 1) cout << "NO";
	else cout << "YES";
}

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

	int T = 1;
//	cin >> T;
	while (T--) {
		solve();
	}
	return 0;
}

