#include <bits/stdc++.h>

#define speed ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define sz(x) (int)x.size()
#define F first
#define S second
#define int long long

const int maxn = 2e5+7;
const int inf = 1e18;
const int mod = 1e9+7;
 
using namespace std;

int used[20][20];
vector<pair<pair<int, int>, int>> g[20][20];
bool check = 0;
char a[20][20];
int cnt1 = 0, cnt2 = 0, cnt3 = 0, cnt4 = 0;
int cnt = 0;

void dfs(int i, int j, int tp){
	if(a[i][j] == '#') cnt++;
	used[i][j] = tp;
	for(pair<pair<int, int>, int> x : g[i][j]){
		int tox = x.F.F, toy = x.F.S, type = x.S;
		if(!used[tox][toy]){
			if(a[tox][toy] == '#' && type == 2){
				check = 1;
				return;
			}
			dfs(tox, toy, type);
		}
	}
}

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] == '#'){
				if(i + 1 <= 10) g[i][j].pb({{i + 1, j}, 1});
				if(j + 1 <= 10) g[i][j].pb({{i, j + 1}, 1});
				if(i - 1 >= 1) g[i][j].pb({{i - 1, j}, 1});
				if(j - 1 >= 1) g[i][j].pb({{i, j - 1}, 1});
				if(i + 1 <= 10 && j + 1 <= 10) g[i][j].pb({{i + 1, j + 1}, 2});
				if(i - 1 >= 1 && j - 1 >= 1) g[i][j].pb({{i - 1, j - 1}, 2});
			}
		}
	}
	for(int i = 1; i <= 10; i++){
		for(int j = 1; j <= 10; j++){
			if(a[i][j] == '#'){
				if(used[i][j] == 0){
					cnt = 0;
					dfs(i, j, 1);
					if(cnt == 4) cnt4++;
					if(cnt == 3) cnt3++;
					if(cnt == 2) cnt2++;
					if(cnt == 1) cnt1++;
					if(cnt > 4){
						check = 1;
					}
				}else{
					if(used[i][j] == 2){
						check = 1;
					}
				}
			}
		}
	}
	if(check){
		cout << "NO\n";
	}else{
		if(cnt4 == 1 && cnt3 == 2 && cnt2 == 3 && cnt1 == 4){
			cout << "YES\n";
		}
	}
}

signed main(){
	speed
	int test = 1;
	// cin >> test;
	while(test--){
		solve();
	}
}