#include <bits/stdc++.h>
#define ll long long
#define int long long
#define Sayan 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(a) a.begin() , a.end()
#define Int(a,x) a+1 , a+1+x
#define sz() size()
#define F first
#define S second
#define pb push_back
#define yes cout << "YES\n"
#define no cout << "NO\n"
#define pii pair<ll,ll>
using namespace std ;

const ll N = 2e5+5;
const ll INF = 1e18;
const ll mod = 1e9+7;

int n,m;
int cnt;

int di[10]{1,-1,0,0,-1,-1,1,1};
int dj[10]{0,0,-1,1,-1,1,1,-1};

char a[15][15];
bool ok[15][15];

map<int,int>mp;

void dfs(int vi,int vj){
	ok[vi][vj]=1;
	for(int i=0;i<8;i++){
		int toi=vi+di[i],toj=vj+dj[i];
		if(1<=toi&&toi<=n&&1<=toj&&toj<=m){
			if((a[toi][toj]=='#')&&(!ok[toi][toj])){
				cnt++;
				dfs(toi,toj);
			}
		}
	}
}

signed main () {
	Sayan;
	int tt=1;
	//  cin>>tt;
	while(tt--){
		n=10;
		m=10;
		for(int i=1;i<=n;i++){
			for(int j=1;j<=m;j++)cin>>a[i][j];
		}
		for(int i=1;i<=n;i++){
			for(int j=1;j<=m;j++){
				if((a[i][j]=='#')&&(!ok[i][j])){
					cnt=1;
					dfs(i,j);
					mp[cnt]++;
				}
			}
		}
		for(int i=1;i<=4;i++){
			if(mp[i]!=(4-i+1)){
				cout<<"NO";
				return 0;
			}
		}
		cout<<"YES";
	}
}
