// #pragma GCC optimize("O3,unroll-loops")
// #pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#include <bits/stdc++.h>
#define ent '\n'
#define all(x) x.begin(), x.end()
#define s second
#define f first
#define pb push_back
typedef long long ll;
using namespace std;
const int maxn = 3e5 + 250;
const int mod = 1e9 + 7;
const int inf = 1e9;
const int K = 400;
const double Pi = acos(-1.0);
const long double eps = 1e-9;
#define yes cout << "YES\n";
#define no cout << "NO\n";
#define int long long
int cal = 0;
char c[50][50];
bool used[50][50];
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int dd[] = {1, -1, 1, -1};
int bb[] = {1, 1, -1, -1};
void dfs(int x, int y) {
    used[x][y] = 1;
    cal++;
    for(int i = 0;i <4; i++) {
        int a = dd[i]+x;
        int b = bb[i]+y;
        if(a>=1&&a<=10&&b>=1&&b<=10&&c[a][b]=='#') {
            no
            exit(0);
        }
    }
    for(int i = 0;i <4; i++) {
        int a = dx[i]+x;
        int b = dy[i]+y;
        if(a>=1&&a<=10&&b>=1&&b<=10&&used[a][b]==0&&c[a][b]=='#') {
            dfs(a,b);
        }
    }
}
void solve() {
    int n = 10;
    for(int i = 1;i <= n; i++) {
        for(int j = 1;j <= n; j++) {
            cin >> c[i][j];
        }
    }
    map<int,int>mp;
    for(int i = 1;i <= n; i++) {
        for(int j = 1;j <= n; j++) {
            if(used[i][j]==0&&c[i][j]=='#') {
                cal =0;
                dfs(i, j);
                mp[cal]++;
            }
        }
    }
    if(mp.size()!=4) {
        no return;
    }
    for(auto x:mp) {
        if(4-x.f+1!=x.s) {
            no return;
        }
    }
    yes
}

signed main () {
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    // freopen("position.in", "r" , stdin);
    // freopen("position.out", "w", stdout);
    int t=1;
    // cin >> t;
    for(int i = 1;i <= t; i++) {
        // cout << "Case " << i << ": ";
        solve();
    }
}