//                   LETS GOOOOOOOOO
#include <bits/stdc++.h>
using namespace std;

#define sz size
#define all(n) n.begin(),n.end()
#define ull unsigned long long
#define ll long long
#define ld long double
#define pb push_back
#define pf push_front
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pdd pair<double, double>
#define len length
#define yes cout<<"YES\n"
#define up upper_bound
#define lb lower_bound
#define no cout<<"NO\n"
#define delb pop_back
#define F first
#define S second
#define sled "\n"
#define vi vector<int>
#define vll vector<long long>
#define gcd __gcd
#define emp empty
#define startt ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define delenie cout<<"\n=========\n"
#define in insert
#define mp make_pair

const long long MOD1=998244353;
const long long MOD2=1e9+7;
const long double Eps = 1e-12;
const int max1 = 1e9*1.4; 
const int min1 = -1e9 *1.4; 
const int mod = 1e9 + 7;
const int N = 2e5 + 100;
const int B = 1e6*2 + 100;
const ll INF = 1e18 + 100;
const int G=1e2+2;


bool vis[10][10];
int ship[5];
int a[20][20];

int main (){
    startt;
    int n=10;
	for(int i=1;i<=n;i++){
		string s;
		cin>>s;
		for(int j=0;j<n;j++){
			if(s[j]=='#'){
				a[i][j+1]=1;
			}
			else{
				a[i][j+1]=0;
			}
		}
	}
	
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			if (a[i][j] == 1) {
				a[i][j] = 0;
				bool gor = false, vert = false, one = false;
				if (a[i+1][j] == 1) {
					vert = true;
				} 
				if (a[i][j+1] == 1) {
					gor = true;
				}
				if (a[i][j+1] == 0 and a[i+1][j] == 0) {
					if (a[i+1][j+1] == 1 or a[i+1][j-1] == 1 or a[i-1][j-1] == 1 or a[i-1][j+1] == 1) {
						cout << "NO";
						return 0;
					}
					one = true;
				}
				if (vert == true and gor == true) {
					cout << "NO";
					return 0;
				}
				int l = 1;
				if (gor) {
					for (int x = j+1; x <= n; x++) {
						if (a[i][x] == 1) {
							a[i][x] = 0;
							if (a[i+1][x] == 1 or a[i+1][x+1] == 1 or a[i-1][x] == 1 or a[i-1][x-1] == 1 or a[i+1][x-1] == 1 or a[i-1][x+1]==1){
								cout << "NO";
								return 0;
							}
							l++;
						} else {
							break;
						}
					}
				} else if (vert) {
					for (int y = i+1; y <= n; y++) {
						if (a[y][j] == 1) {
							a[y][j] = 0;
							if (a[y][j+1] == 1 or a[y][j-1] == 1 or a[y+1][j+1] == 1 or a[y+1][j-1] == 1 or a[y-1][j-1] == 1 or a[y-1][j+1] == 1){
								cout << "NO";
								return 0;
							}
							l++;
						} else {
							break;
						}
					}
				}
				if (l > 4) {
					cout << "NO";
					return 0;
				}
				ship[l]++;
			}	
		}
	}
	for(int i=1;i<=4;i++){
		if(ship[i]!=5-i){
			cout << "NO";
			return 0;
		}
	}
	cout<< "YES";
}
