#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define pb push_back
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define int long long
#define f first
#define s second
template<class T>bool umax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<class T>bool umin(T &a,T b){if(b<a){a=b;return true;}return false;}
typedef tree<int, null_type, less_equal<int>, rb_tree_tag,
	tree_order_statistics_node_update> ordered_set;
const int mod= 1e9 +7;
const int N=1e5*4;

int binpow (int a, int n) {
	if (n == 0)
		return 1;
	if (n % 2 == 1)
		return binpow (a, n-1) * a;
	else {
		int b = binpow (a, n/2);
		return b * b;
	}
}

char a[12][12];
int vis[12][12];

void solve(){
	
	for(int i = 0;i < 12;i++){
		for(int j = 0;j < 12;j++){
			a[i][j] = '.';
		}
	}
	
	for(int i = 1;i <= 10;i++){
		for(int j = 1;j <= 10;j++){
			cin>>a[i][j];
		}
	}
	map<int,int> mp;
	for(int i = 1;i <= 10;i++){
		for(int j = 1;j <= 10;j++){
			if(a[i][j] == '#' && vis[i][j] == 0){
				if(a[i + 1][j] == '#'){
					int ni = i,nj = j;
					int h = 0,k =0;
					while(ni >= 1 && nj >= 1 && ni <= 10 && nj <= 10 && a[ni][nj] == '#'){
						if(a[ni + 1][nj + 1] == '#' || a[ni - 1][nj - 1] == '#'){
							cout<<"NO";
							return;
						}
						if(a[ni][nj + 1] == '#' || a[ni][nj - 1] == '#'){
							cout<<"NO";
							return;
						}
						vis[ni][nj] = 1; 
						ni++;
						k++;
					}
					mp[k]++;
				} else{
					int ni = i,nj = j;
					int h = 0,k =0;
					while(ni >= 1 && nj >= 1 && ni <= 10 && nj <= 10 && a[ni][nj] == '#'){
						if(a[ni + 1][nj + 1] == '#' || a[ni - 1][nj - 1] == '#'){
							cout<<"NO";
							return;
						}
						if(a[ni + 1][nj] == '#' || a[ni - 1][nj] == '#'){
							cout<<"NO";
							return;
						}
						vis[ni][nj] = 1;
						nj++;
						h++;
					}
					mp[h]++;
				}
				
			}
		}
	}
	for(int i = 1;i <= 4;i++){
		if(i == 1){
			if(mp[i] != 4){
				cout<<"NO";
				return;
			}
		}
		if(i == 2){
			if(mp[i] != 3){
				cout<<"NO";
				return;
			}
		}
		if(i == 3){
			if(mp[i] != 2){
				cout<<"NO";
				return;
			}
		}
		if(i == 4){
			if(mp[i] != 1){
				cout<<"NO";
				return;
			}
		}
		
	}
	cout<<"YES";






}

 signed main()
{
//	freopen("seq.in", "r", stdin);
//  freopen("seq.out", "w", stdout);
	ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
	int cnt=0;
	int tt=1;
//	cin>>tt;
	while(tt--)solve();

}


