#include <bits/stdc++.h>
 
using namespace std;
 
#define speed ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define rall(x) x.rbegin(), x.rend()
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define nl '\n'
// #define int long long 
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef long double ld;
 
const int N = 1e6 + 5;
const int inf = 1e9+123;
const ll INF = 1e15 + 5;
const int mod = 1e9 + 7;
const int P = 31;
 
int a[10][10];
int used[10][10];
pii d[] = {{0, 1}, {0, -1}, {1, 0}, {-1, 0}};
pii d1[] = {{1, 1}, {-1, -1}, {1, -1}, {-1, 1}};
 
void dfs(int i, int j, vector<pii> &had){
    used[i][j] = 1;
    had.pb({i, j});
    for(int k = 0; k < 4; k++){
        int di = d[k].F + i, dj = d[k].S + j;
        if(di < 0 || di >= 10 || dj < 0 || dj >= 10 || used[di][dj])
            continue;
        dfs(di, dj, had);
    }
}
 
void solve(){
    for(int i = 0; i < 10; i++){
        for(int j = 0; j < 10; j++){
            char c;
            cin >> c;
            if(c == '.')
                used[i][j] = 1;
            else
                used[i][j] = 0;
        }
    }
    vector<int> cnt(5, 0);
    bool bad = false;
    for(int i = 0; i < 10; i++){
        for(int j = 0; j < 10; j++){
            if(used[i][j])
                continue;
            for(int k = 0; k < 4; k++){
                int di = d1[k].F + i, dj = d1[k].S + j;
                if(di < 0 || di >= 10 || dj < 0 || dj >= 10)
                    continue;
                if(!used[di][dj]){
                    bad = true;
                }
            }
        }
    }
    for(int i = 0; i < 10; i++){
        for(int j = 0; j < 10; j++){
            if(!used[i][j]){
                vector<pii> had = {};
                dfs(i, j, had);
                bool eqi = true, eqj = true;
                for(int i = 1; i < sz(had); i++){
                    if(had[i].F != had[i - 1].F)
                        eqi = false;
                    if(had[i].S != had[i - 1].S)
                        eqj = false;
                }
                if(!eqi && !eqj){
                    bad = true;
                    break;
                }
                if(sz(had) > 4){
                    bad = true;
                    break;
                }
                cnt[sz(had)]++;
            }
        }
        if(bad)
            break;
    }
    for(int i = 1; i <= 4; i++){
        if(cnt[i] != (4 - i + 1)){
            bad = true;
        }
    }
    cout << (!bad ? "YES\n" : "NO\n");
}
 
signed main() {
    speed;
    int T = 1;
    // cin >> T;
    while(T--)
        solve();
}