#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define pf push_front
#define ppf pop_front
#define ppb pop_back
#define mp make_pair
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define ll long long
#define ld long double
const ll N = 2e5 + 7;
const ll mod = 1e9 + 7;
const ll inf = 1e18;
const ld pi = 3.141592653589793;
const ld eps = 1e-12;
const ll zero = 0;
const int MAX = 1e6+5;
const int A = 1e9 + 5;
/*if you cant solve the problem:
try optimized(clever) brute-force;
try prefix sums with/or binary search
try dp
try dfs
try to sort(sort(a+1,a+1+n)
int overflow, array bounds
think about special cases( n=1?)
*/

char a[150][150];
ll u[150][150],s[100];
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll n=10,m=10;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			cin>>a[i][j];
		}
	}
	ll q=0;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			if(a[i][j]=='#'){
				if(a[i][j+1]=='#'){
					ll pos=j;
					while(j<=m && a[i][j]=='#'){
						if(a[i+1][j+1]=='#' or a[i-1][j-1]=='#' or a[i-1][j+1]=='#' or a[i+1][j-1]=='#' or a[i-1][j]=='#' or a[i+1][j]=='#')
							q=1;
						u[i][j]=1;
						j++;
					}
					s[j-pos]++;
				}
			}
		}
	}
	for(int j=1;j<=m;j++){
		for(int i=1;i<=n;i++){
			if(a[i][j]=='#' && u[i][j]==0){
				ll pos=i;
				while(i<=n && a[i][j]=='#'){
					if(a[i+1][j+1]=='#' or a[i-1][j-1]=='#' or a[i-1][j+1]=='#' or a[i+1][j-1]=='#' or a[i][j+1]=='#' or a[i][j-1]=='#')
						q=1;
					u[i][j]=1;
					i++;
				}
				s[i-pos]++;
			}
		}
	}
	if(q==0 && s[1]==4 && s[2]==3 && s[3]==2 && s[4]==1){
		for(int i=5;i<=13;i++){
			if(s[i]>0){
				q=1;
			}
		}
		if(q==0)
			cout<<"YES";
		else
			cout<<"NO";
	}
	else{
		cout<<"NO";
	}
}

























