#include <bits/stdc++.h>
#define ll long long
#define all(a) a.begin(), a.end()
#define F first
#define S second
#define pb push_back
#define eb emplace_back
#define ull unsigned long long
#define ld long double
#define files freopen("HelpMe.in", "r", stdin), freopen("HelpMe.out", "w", stdout)
using namespace std;
const ll mod = 1e9+7;
const ll N = 10 + 10;
const ll P = 337ll;
const ld EPS = 1e-9;
const ll block = 400;
bool arr[N][N], used[N][N];
ll cnt[N];
ll dx[5] = {0, 0, -1, 1};
ll dy[5] = {-1, 1, 0, 0};
ll dfs(ll x, ll y){
	ll ans = 0;
	used[x][y] = true;
	for(ll i = 0, xx, yy; i < 4; i++){
		xx = x + dx[i];
		yy = y + dy[i];
		if(used[xx][yy] == false && arr[xx][yy] == true){
			ans += dfs(xx, yy);
		}
	}
	return ans + 1;
}
int main() {
	ios::sync_with_stdio(false);
  	cin.tie(NULL);
  	//freopen("race.in","r",stdin);
  	//freopen("race.out","w",stdout);
  	ll n = 10;
  	bool can = true;
  	for(ll i = 1; i <= n; i++){
  		string s;
  		cin >> s;
  		for(ll j = 1; j <= n; j++){
  			if(s[j - 1] != '.') arr[i][j] = true;
  		}
  	}
  	for(ll i = 1; i <= n; i++){
  		for(ll j = 1; j <= n; j++){
  			if(arr[i][j] == 0) continue;
  			bool s1 = false, s2 = false;
  			if(arr[i + 1][j + 1] == true) can = false;
  			if(arr[i + 1][j - 1] == true) can = false;
  			if(arr[i - 1][j + 1] == true) can = false;
  			if(arr[i - 1][j - 1] == true) can = false;

  			if(arr[i + 1][j] == true) s1 = true;
  			if(arr[i - 1][j] == true) s1 = true;
  			if(arr[i][j + 1] == true) s2 = true;
  			if(arr[i][j - 1] == true) s2 = true;
  			if(s1 && s2) can = false;
  		}
  	}
  	for(ll i = 1; i <= n; i++){
  		for(ll j = 1; j <= n; j++){
  			if(arr[i][j] == 0 || used[i][j] == true) continue;
  			ll count = dfs(i, j);
  			//cout << count << endl;
  			cnt[count]++;
  		}
  	}
  	if(cnt[1] != 4 || cnt[2] != 3 || cnt[3] != 2 || cnt[4] != 1) can = false;
  	if(can) cout << "YES";
  	else cout << "NO";
  return 0;
}
// equal, min, max, 1, random
/*

*/
