#include <bits/stdc++.h>
using namespace std;
#define ios ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fr first
#define sc second
#define endl "\n"
#define ll long long
#define int ll
void fopn(string name){
	freopen((name+".in").c_str(),"r",stdin);
	freopen((name+".out").c_str(),"w",stdout);
}
const ll N=2e5+5,INF=1e18,mod=1e9+7;
int a[15][15],used[15][15];
vector<int> dx = {1,-1,0,0},
			dy = {0,0,-1,1};
int dfs(int x, int y){
	used[x][y]=1;
	int cnt=1;
	for(int i=0;i<4;i++){
		if(!used[x+dx[i]][y+dy[i]] && a[x+dx[i]][y+dy[i]])
			cnt+=dfs(x+dx[i],y+dy[i]);
	}
	return cnt;
}
void solve(){
	 vector<int> v(5);
	 for(int i=1;i<=10;i++){
		 for( int j=1;j<=10;j++){
			 char c;cin>>c;
			 if(c=='#') a[i][j]=1;
			 else a[i][j]=0;
		}
	 }
	 
	 for(int i=1;i<=10;i++){
		 for(int j=1;j<=10;j++){
			 if(a[i][j] && a[i-1][j-1]){
				 cout<<"NO\n";
				 return;
			 }
			 if(a[i][j] && a[i-1][j+1]){
				 cout<<"NO\n";
				 return;
			 }
			 if(a[i][j] && a[i+1][j-1]){
				 cout<<"NO\n";
				 return;
			 }
			 if(a[i][j] && a[i+1][j+1]){
				 cout<<"NO\n";
				 return;
			 }
			 if(used[i][j] || !a[i][j]) continue;
			 int tmp=dfs(i,j);
			 if(tmp>4){
				 cout<<"NO\n";
				 return;
			 }
			 v[tmp]++;
		 }
	 }
	 if(v[4]==1 && v[3]==2 && v[2]==3 && v[1]==4) cout<<"YES";
	 else cout<<"NO";
}
main(){
	ios;
	int T=1;
	//cin>>T;
	for(int i=1;i<=T;i++){
		//cout<<"Case #"<<i<<": ";
		solve();
	}
}

