#include <bits/stdc++.h>
#define ll long long
#define pii pair<int,int>
#define F first
#define S second
#define pb push_back
using namespace std;
const int N = 2e5 + 5;
const int MN = 1e9 + 10;
char a[10][10];
int q[5],b[10][10];
bool c;
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	for(int i = 0;i<10;i++){
		for(int j = 0;j<10;j++){
			cin>>a[i][j];
		}
	}
	
	for(int i = 0;i<10;i++){
		for(int j = 0;j<10;j++){
			c = 1;
			if(a[i][j]!='#')continue;
			
			if(i>0 && a[i-1][j]=='#' ){
					b[i][j] = 1+b[i-1][j];
					if( b[i][j]>4 ){
						cout<<"NO";
						return 0;
					}
					q[b[i][j]]++;
					q[b[i][j]-1]--;
					c = 0;
			}
			if(j>0 && a[i][j-1]=='#'){
					b[i][j] = 1+b[i][j-1];
					q[b[i][j]]++;
					q[b[i][j]-1]--;
					if(b[i][j]>4){
						cout<<"NO";
						return 0;
					}
					c = 0;
			}
			if(j+1<10 && i+1<10 && a[i][j]=='#' && a[i+1][j+1]=='#'){
				cout<<"NO";
				return 0;
			}
			if(j-1>0 && i+1<10 && a[i][j]=='#' && a[i+1][j-1]=='#'){
				cout<<"NO";
				return 0;	
			}
			if((i==0 && j==0) or c==1){
				b[i][j]=1;
				q[1]++;
			}
			
		}
	}
	
	if(q[1]!=4||q[2]!=3||q[3]!=2||q[4]!=1){
		//cout<<q[1]<<" "<<q[2]<<" "<<q[3]<<" "<<q[4]<<"\n";
		cout<<"NO";
		return 0;
	}
	cout<<"YES";
	return 0;
}
/*
pair <int,int> a[N];
a[i].first,a[i].second;
srand(time(0));
    char c = 'A' + (rand() % 24);
    cout << c;
int to string
	int number = i;
		ostringstream convert;
		convert << number;
		string str = convert.str();
string to int

string str = "42";
    int number = atoi(str.c_str());
    cout << number << endl;

    string floatStr = "3.14";
    float floatValue = atof(floatStr.c_str());
    cout << floatValue << endl;

for(set<int>::iterator it=s.begin(); it!=s.end(); it++){
cout<<*it<<" ";
cout<<it->first<<" "<<it->second;
}

map
cin>>s>>ss;
s.insert(make_pair(s,ss));

sort
	.
	.
   . .
    .
bool cmp(pii a,pii b){
	if (a.F == b.F){
		return a.S < b.S;
	}
//	if (a.F > b.F) return 1;
//	else return 0;
	return a.F > b.F;
}

map<ll, ll> factors;

		    for (int i = 2; i <= sqrt(n); i++) {
		        while (n % i == 0) {
		            factors[i]++;
		            n /= i;
		        }
		    }

		    if (n != 1) {
		        factors[n]++;
		    }

		    for(auto now : factors){
		    	cout<<now.F<<"^"<<now.S<<" ";

			}



			ll binpow(ll a, ll b){
	a %= mod;
	if(b == 0){
		return 1;
	}
	if(b % 2 == 1){
		return binpow (a, b - 1) % mod * a;
	}
	if(b % 2 == 0){
		ll t = binpow (a, b / 2) % mod;
		return t * t % mod;
	}
}
	*/
