#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define sqr(x) abs((x) * (x))
#define sume(a) (accumulate(all(a), 0ll))
#define mine(a) (*min_element(all(a)))
#define maxe(a) (*max_element(all(a)))
bool getbit (int mask, int bit) {return (mask & (1 << bit));}
bool is_sqrt (int a) {double x = sqrt(a); if (x == (int)x) return 1; return 0;}
typedef long long ll;
typedef long double ld;
typedef void hahahahahaha;
ll lcm (ll a, ll b) {return (a / __gcd(a, b) * b);}
typedef unsigned long long ull;
const unsigned long long MOD = 1e9 + 7;
const ull N = 2e5 + 5;
const ll dx[]={-1, 1, -1, 1};  
const ll dy[]={-1, 1, 1, -1};
ll binpow (ll a, ll n) { if (n == 0) return 1; if (n % 2 == 1) return binpow (a, n-1) % MOD * a % MOD;else {ll b = binpow (a, n / 2);return b % MOD * b % MOD;}}
//vector <ll> g[N];int used[N];ll d[N];int p[N];
//char c[N][N];
//void ptt (int x, int y) {g[x].pb(y);g[y].pb(x);}
bool used[14][14];
hahahahahaha hahahahahah () {
	char c[12][12];
	for (int i = 1; i <= 10; i ++) {
		for (int j = 1; j <= 10; j ++) {
			cin >> c[i][j];
		}
	}
	int n = 10;
	int cnt1 = 0, cnt2 = 0, cnt3 = 0, cnt4 = 0;
	for (int i = 1; i <= n; i ++) {
		for (int j = 1; j <= n; j ++) {
			if (used[i][j]) continue;
			if (c[i][j] == '#') {
				if ((c[i][j + 1] == '#' && c[i][j - 1] == '#') || (c[i - 1][j] == '#' && c[i + 1][j] == '#')) continue;
				int cnt = 1;
				if (c[i - 1][j] == '#' && c[i + 1][j] != '#') {
					if (used[i - 1][j]) continue;
					used[i - 1][j] = 1;
					cnt ++;
					if (c[i - 2][j] == '#') {
						if (used[i - 2][j]) continue;
						used[i - 2][j] = 1;
						cnt ++;
						if (c[i - 3][j] == '#') {
							if (used[i - 3][j]) continue;
							cnt ++, used[i - 3][j] = 1;
						}
					}
				}
				else if (c[i + 1][j] == '#' && c[i - 1][j] != '3') {
					if (used[i + 1][j]) continue;
					used[i + 1][j] = 1;
					cnt ++;
					if (c[i + 2][j] == '#') {
						if (used[i + 2][j]) continue;
						used[i + 2][j] = 1;
						cnt ++;
						if (c[i + 3][j] == '#') {
							if (used[i + 3][j]) continue;
							cnt ++, used[i + 3][j] = 1;
						}
					}
				}
				else if (c[i][j - 1] == '#' && c[i][j + 1] != '#') {
					if (used[i][j - 1]) continue;
					used[i][j - 1] = 1;
					cnt ++;
					if (c[i][j - 2] == '#') {
						if (used[i][j - 2]) continue;
						used[i][j - 2] = 1;
						cnt ++;
						if (c[i][j - 3] == '#') {
							if (used[i][j - 3]) continue;
							cnt ++, used[i][j - 3] = 1;
						}
					}
				}
				else if (c[i][j + 1] == '#' && c[i][j - 1] != '#') {
					if (used[i][j + 1]) continue;
					used[i][j + 1] = 1;
					cnt ++;
					if (c[i][j + 2] == '#') {
						if (used[i][j + 2]) continue;
						cnt ++;
						used[i][j + 2];
						if (c[i][j + 3] == '#') {
							if (used[i][j + 3]) continue;
							cnt ++, used[i][j + 3];
						}
					}
				}
				for (int k = 0; k < 4; k ++) {
					int x = i + dx[k], y = j + dy[k];
					if (c[x][y] == '#') {
						cout << "NO";
						return;
					}
				}
				used[i][j] = 1;
				if (cnt == 1) {
					cnt1 ++;
					//cout << i << ' ' << j << '\n';
				}
				else if (cnt == 2) {
					cnt2 ++;
					//cout << i << ' ' << j << '\n';
				}
				else if (cnt == 3) {
					cnt3 ++;
					//cout << i << ' ' << j << '\n';
				}
				else if (cnt == 4) {
					cnt4 ++;
					//cout << i << ' ' << j << '\n';
				}
			}
		}
	}
	if (cnt1 != 4 || cnt2 != 3 || cnt3 != 2 || cnt4 != 1) {
		cout << "NO";
		return;
	}
	cout << "YES";
}

int main() {
	//freopen("hps.in", "r", stdin); freopen("hps.out", "w", stdout);
	ios_base::sync_with_stdio(0); cout.tie(0); cin.tie(0); cout.setf(ios::fixed);cout.precision(10);
    int hahahahaha = 1; //cin >> hahahahaha;
    //int cnt = 1;
	while (hahahahaha --) {
		//cout << "Case " << cnt++ << ": ";
		hahahahahah();
		cout << '\n';
	}
	return 0;
}
	
