#include <bits/stdc++.h>

#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("03")

#define frpn		freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define mm(x) 		memset(x, 0, sizeof(x))
#define all(x)		(x).begin(), (x).end()
#define rs(x) 		((x) << 1 | 1)
#define ls(x) 		((x) << 1)
#define pb			push_back
#define int			long long
#define sz			size()
#define S 			second
#define F 			first

using namespace std;

const int N = 1e5;

int intx () {
	int x;
	cin >> x;
	return x;
}
char c[13][13];
int kont[13][13];

void solve() {
	for(int i = 0; i <= 11; i++){
		for(int j = 0; j <= 11; j++){
			c[i][j] = '0';
		}
	}
	for(int i = 1; i <= 10; i++){
		for(int j = 1; j <= 10; j++){
			cin >> c[i][j];
		}
	}
	//
	for (int i = 1; i <= 10; i++) {
		for (int j = 1; j <= 10; j++) {
			if ((c[i][j] == '#' && c[i + 1][j] == '#' && c[i][j + 1] == '#') || (c[i][j] == '#' && (c[i + 1][j - 1] == '#' || c[i + 1][j + 1] == '#'))) {
				cout << "NO";
				return;
			}		
		}
	}
	//
	int c4 = 0, c3 = 0, c2 = 0, c1 = 0;
	for (int i = 1; i <= 10; i++) {
		for (int j = 1; j <= 10; j++) {
			if (c[i][j] == '#' && (c[i + 1][j] == '#' || c[i][j + 1] == '#')) {
				kont[i][j] = kont[i - 1][j] + kont[i][j - 1] + 1;
			} else {
				if (c[i][j] == '#') {
					int cnt = kont[i - 1][j] + kont[i][j - 1] + 1;
					if (cnt == 4) c4++;
					else if (cnt == 3) c3++;
					else if (cnt == 2) c2++;
					else c1++;
				}
			}
		}		
	}
	if (c4 == 1 && c3 == 2 && c2 == 3 && c1 == 4) cout << "YES";
	else cout << "NO";
//	cout << c4 << " " << c3 << " " << c2 << " " << c1; 
}

signed main () {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

	int t = 1;
//	cin >> t;
	while (t--) {
		solve();
	}

	return 0;
}

