#include <bits/stdc++.h>

#define int long long
#define ll long long
#define all(x) x.begin() , x.end()
#define F first
#define S second
#define sz size()
#define dibamboo ios::sync_with_stdio(0); cin.tie(0);
#define pb push_back
#define ins insert
#define nol (int)0
#define gcd(a , b) __gcd(a , b)                                                                                                                                                                 

using namespace std;

const int inf = 1e9;
const int MOD = 1e9+7;
const int N = 1e5+3 , N1 = 1e3+3;
const long double eps = 1e-11;

//int bp[N] , fact[N];

//int cnk(int n , int k){
//	return fact[n] * bp[k] * bp[n - k];
//}

ll pp(int v , int k){
	if(k == 0) return 1;
	if(k % 2 != 0) return pp(v , k - 1) * v % MOD;
	int val = pp(v , k / 2);
	return val * val % MOD;
}

vector <int> g[N]; int sum = 0; int used[N];

void dfs(int v){
	sum++;
	used[v]++;
	for(auto to : g[v]) if(!used[to]) dfs(to);
}

void code(){
	int id = 0 , cc = 0;
	map <pair <int , int> , int> mp; map <int , int> mp1;
	for(int i = 1; i <= 10; i++){
		for(int j = 1; j <= 10; j++){
			char x;
			cin >> x;
			if(x == '.') continue;
			mp[{i , j}] = ++id;
			int to = mp[{i - 1 , j}] , to1 = mp[{i , j - 1}];
			if(to && to1 || cc){
				cc = 1;
				continue;
			}
			if(to){
				g[id].pb(to);
				g[to].pb(id);
			}
			if(to1){
				g[id].pb(to1);
				g[to1].pb(id);
			}
 		}
	}
	for(int i = 1; i <= 10; i++){
		if(cc) break;
		for(int j = 1; j <= 10; j++){
			if(mp[{i , j}] == 0) continue;
			int col = 0;
			if(mp[{i + 1 , j}] || mp[{i - 1 , j}]) col++;
			if(mp[{i , j + 1}] || mp[{i , j - 1}]) col++;
			if(mp[{i - 1 , j - 1}] || mp[{i + 1 , j + 1}] || mp[{i - 1 , j + 1}] || mp[{i + 1 , j - 1}]) cc = 1;
			if(col > 1 || cc){
				cc = 1;
				break;
			}
		}
	}
	if(cc){
		cout << "NO";
		return;
	}
	for(int i = 1; i <= id; i++){
		if(!used[i]){
			sum = 0;
			dfs(i);
			mp1[sum]++;
		}
	}
	if(mp1[4] == 1 && mp1[3] == 2 && mp1[2] == 3 && mp1[1] == 4) cout << "YES";
	else cout << "NO";
}



signed main(){
	dibamboo
//	cout.tie(0);
//    freopen("hps.in" , "r" , stdin);
//    freopen("hps.out" , "w" , stdout);
//    fact[0] = bp[0] = 1;
    int tt = 1;
//    cin >> tt;
	for(int id111 = 1; id111 <= tt; id111++){
//		cout << "Case " << id111 << ": ";
		code();
	}
}