#include <bits/stdc++.h>
using namespace std;
/*
<<<<It's never too late for a new beginning in your life>>>>
Today is hard
  tomorrow will worse
  but the day after tomorrow will be the sunshine..

HARD WORK BEATS TALENT WHEN TALENT DOESN'T WORK HARD............
Never give up  */

//The most CHALISHKANCHIK
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL);
#define endl '\n'
#define ff first
#define ss second
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define pb push_back
#define rew(i, a, b) for(int i = a; i < b; i++)
#define wer(i, a, b) for(int i = b - 1; i >= a; i--)
#define int long long
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vii;
	int us[10][10]{};
	char a[10][10];
	int cr[5];
vi d1 = {0, 1, -1 , 0};
vi d2 = {1, 0, 0, -1};
vi ald1 = {-1,-1, 1, 1};
vi ald2 = {-1, 1, 1, -1};
int ch(int i, int j){
	int cnt = 0;
	for(int k = 0; k <= 4; k++){
		int toi = i+ald1[k], toj = j+ald2[k];
		if(toi < 0 || toj < 0 || toi > 9 || toj > 9)continue;
		if(a[toi][toj] == '#' && !us[toi][toj]){
			cnt++;
		}
	}
	return cnt;
}
bool dfs(int i, int j, int d, int cnt){
	if(ch(i, j) > 0)return 0;
	us[i][j] = 1;
	if(a[i+d1[d]][j+d2[d]] == '#')return dfs(i + d1[d], j + d2[d], d, cnt+1);
	cr[cnt]++;
	if(cr[cnt] > 5-cnt || cnt > 4)return 0;
	return 1;
}
void solve(){
	rew(i,0,10){
		rew(j, 0, 10){
			cin >> a[i][j];
		}
	}
	rew(i,0,10){
		rew(j, 0, 10){
			if(!us[i][j] && a[i][j] == '#'){
				int f = 0;
				for(int k = 0; k < 4; k++){
					if(a[i+d1[k]][j+d2[k]] == '#'){
						if(!dfs(i, j, k, 1)){
							cout << "NO" << endl;
							return;
						}
						f = 1;
						break;
					}
				}
				if(ch(i, j)>0){
					cout << "NO" << endl;
					return;
				}else if(!f){
					cr[1]++;
				}
			}
		}
	}
	for(int i = 1; i <= 4; i++){
		if(cr[i] != 5-i){
			cout << "NO" << endl;
			return;
		}
	}
	cout << "YES" << endl;
}
main(){
	//~ ios
	int t = 1;
	//~ cin >> t;
	while(t--){
		solve();
	}
}










