//susanoo.fx;

// #pragma comment(linker, "/stack:200000000")
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
 

#include "bits/stdc++.h"
using namespace std;


void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define dbg(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define dbg(x...)
#endif


#define SpeedForce          ios_base::sync_with_stdio(0);cin.tie(0);
#define ff                  first
#define ss                  second
#define ll                  long long
#define ull                 unsigned long long
#define pb                  push_back
#define in                  insert
#define vll                 vector<ll>
#define sll                 set<ll>
#define skip                continue
#define dnl                 nl << nl
#define sz(x)               (int)x.size()
#define all(x)              (x).begin(),(x).end()
#define rall(x)             (x).rbegin(),(x).rend()
#define out(v)              for(auto& i : v) cout << i << ' ';


const int N = 1e6 + 12 ;
const long long modd = 1e9 + 7;
const int inf = INT_MAX;
const string alf = "abcdefghijklmnopqrstuvwxyz";
const char nl = '\n' ;
const short dRow[] = {1 , 0 , -1 , 0} ;
const short dCol[] = {0 , 1 , 0 , -1} ;

                                    
void setFO(string s){
    if(s.empty()) return ;
    freopen((s + ".in").c_str(), "r", stdin);
    freopen((s + ".out").c_str(), "w", stdout);    
}

char a[12][12];
bool mpp[12][12];
int used[12][12];
unordered_map<int , int > cnt;
int cur = 0;

int go(int x , int y){
	cur ++;
	used[x][y] = 1;
	for(int i = 0; i < 4; i ++){
		int dx = x + dRow[i];
		int dy = y + dCol[i];
		if (!used[dx][dy] && dx >= 1 && dx <= 10 && dy >= 1 && dy <= 10){
			if (a[dx][dy] != '#')continue;
			go(dx , dy);
		}
	}
	return cur;
}

void solve(){
    #define test
    multiset <pair <ll, ll>> v;
    // map <pair <ll, ll>, bool> mpp;
    bool ok1 = 1;
    for (ll i = 1; i <= 10; ++ i) {
    	for (ll j = 1; j <= 10; ++ j) {
    		cin >> a[i][j];
    		// dbg(a[i][j]);
    		if (a[i][j] == '#'){
	    		v.in({i, j});
	    		mpp[i][j] = 1;
    		}
    	}
    }
    for (auto to : v) {
    	ll x = to.ff, y = to.ss;
    	// dbg(x, y);
    	// dbg(mpp[x][y]);
    	if (mpp[x - 1][y - 1] + mpp[x + 1][y - 1] + mpp[x + 1][y + 1] + mpp[x - 1][y + 1] > 0) {
    		// dbg("fdf");
    		cout << "NO" ;
    		return;
    	}
    }
    // dbg(v);
    map <ll, ll> mp;
    for (auto to : v) {
    	ll x = to.ff, y = to.ss;
    	// dbg()
    	bool ver = 0, gor = 0, odin = 0;
    	if (a[x + 1][y] == '#' || a[x - 1][y] == '#'){
    		ver = 1;
    	} 
    	if (a[x][y + 1] == '#' || a[x][y - 1] == '#'){
    		gor = 1;
    	} 
    	if (ver && gor) {
    		cout << "NO" << nl;
    		return;
    	}
    }
    for(auto to : v){
    	cur = 0;
    	if (used[to.ff][to.ss])continue;
    	int col = go(to.ff , to.ss);
    	cnt[col] ++;
    	if (cnt[1] > 4 || cnt[2] > 3 || cnt[3] > 2 || cnt[4] > 1){
    		cout <<"NO";
    		return;
    	}
    }
    if (cnt[1] == 4 && cnt[2] == 3 && cnt[3] == 2 && cnt[4] == 1) {
    	cout << "YES" << nl;
    	return;
    }else cout << "NO";
}   


signed main(){
    SpeedForce;
    // setFO("");
    //precalc();
    int T = 1 ;
    int tt = 1;
    #ifdef tests
        cin >> T ;
    #endif
        while(T--){
            // cout << "Case " << tt << ": " << nl;
            solve() ;
            tt ++;
        }
    return 0 ;
}

// ctrl + alt + d for run in cmd