// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define ln "\n"
#define ff first
#define ss second
using namespace std;
using namespace __gnu_pbds;


void solve(){
	vector<vector<char>> gr(10, vector<char>(10));
	for (ll i=0; i<10; i++){
		for (ll j=0; j<10; j++) cin >> gr[i][j];
	}
	ll n = 10;
	for (ll i=0; i<n; i++){
		for (ll j=0; j<n; j++){
			if (gr[i][j]=='#'){
				if ((i and gr[i-1][j]=='#' and j and gr[i][j-1]=='#') or (i and j and gr[i-1][j-1]=='#') or (i and j+1<n and gr[i-1][j+1]=='#')){
					cout << "NO\n"; return;
				}
			}
		}
	}
	vector<ll> st;
	for (ll i=0; i<n; i++){
		for (ll j=0; j<n; j++){
			if (gr[i][j]=='#' and ((i==n-1 or gr[i+1][j]!='#') and (j==n-1 or gr[i][j+1]!='#'))){
				
				if (j and gr[i][j-1]=='#'){
					ll cst=0;
					for (ll k=j; k>=0; k--){
						if (gr[i][k]=='#') cst++;
						else break;
					}
					st.push_back(cst);
				}else if (i and gr[i-1][j]=='#'){
					ll cst=0;
					for (ll k=i; k>=0; k--){
						if (gr[k][j]=='#') cst++;
						else break;
					}
					st.push_back(cst);
				}else{
					st.push_back(1);
				}
			}
		}
	}
	// for (auto ch:st) cout << ch << " ";
	// cout <<  ln;
	vector<ll> ships = {1, 1, 1, 1, 2, 2, 2, 3, 3, 4};
	ll cn = 9;
	sort(st.begin(), st.end());
	if (st.size()!=10){
		cout << "NO" << ln; return;
	}
	for (ll i=0; i<10; i++){
		if (st[i]!=ships[i]) {
			cout << "NO" << ln; return;
		}
	}
	cout << "YES"; return;
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	ll t=1; 
	// cin >> t;
	while (t--) solve();
}