#include <bits/stdc++.h>
 
#define speed ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define sz(x) (int)x.size()
#define F first
#define S second
#define int long long
 
const int maxn = 2e5+7;
const int inf = 1e18;
const int mod = 1e9+7;
  
using namespace std;
 
bool used[20][20];
vector<pair<int, int>> g[20][20];
bool check = 0;
char a[20][20];
int cnt1 = 0, cnt2 = 0, cnt3 = 0, cnt4 = 0;
int cnt = 0;
int sum = 0;
 
void dfs(int i, int j){
    if(a[i][j] == '#') cnt++;
    used[i][j] = 1;
    for(pair<int, int> x : g[i][j]){
        int tox = x.F, toy = x.S;
        if(!used[tox][toy]){
            dfs(tox, toy);
        }
    }
}
 
void solve(){
    for(int i = 1; i <= 10; i++){
        for(int j = 1; j <= 10; j++){
            cin >> a[i][j];
        }
    }
    for(int i = 1; i <= 10; i++){
        for(int j = 1; j <= 10; j++){
            if(a[i][j] == '#'){
                if(i + 1 <= 10) g[i][j].pb({i + 1, j});
                if(j + 1 <= 10) g[i][j].pb({i, j + 1});
                if(i - 1 >= 1) g[i][j].pb({i - 1, j});
                if(j - 1 >= 1) g[i][j].pb({i, j - 1});
            }
        }
    }
    for(int i = 1; i <= 10; i++){
        for(int j = 1; j <= 10; j++){
            if(a[i][j] == '#'){
                if(used[i][j] == 0){
                    cnt = 0;
                    dfs(i, j);
                    sum += cnt;
                    if(cnt == 4) cnt4++;
                    if(cnt == 3) cnt3++;
                    if(cnt == 2) cnt2++;
                    if(cnt == 1) cnt1++;
                }
                if(i + 1 <= 10 && j + 1 <= 10){
    				if(!used[i + 1][j + 1] && a[i + 1][j + 1] == '#'){
    					cout << "NO\n";
    					return;
    				}
    			}
                if(i - 1 >= 1 && j - 1 >= 1){
                	if(!used[i - 1][j - 1] && a[i - 1][j - 1] == '#'){
                		cout << "NO\n";
                		return;
                	}
                }
            }
        }
    }
    if(sum != 20){
    	cout << "NO\n";
    	return;
    }
    if(cnt4 != 1 || cnt3 != 2 || cnt2 != 3 || cnt1 != 4){
    	cout << "NO\n";
    	return;
    }
    cout << "YES\n";
}
 
signed main(){
    speed
    int test = 1;
    // cin >> test;
    while(test--){
        solve();
    }
}