#include <iostream>
#include <vector>

using namespace std;
 
typedef long long ll;

#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma optimization_level 3
 
// Defines
 
#define pb push_back // kak push_back 5
#define endl '\n'
#define FOR(i,start,end) for(int i = start;i < end;i ++)
#define REV(i,start,end) for(int i = start;i >= end;i --)
#define precal(x) fixed << setprecision(x)
#define F first
#define S second
#define sz(x) (ll)x.size()
#define all(x) (x).begin(),(x).end()
#define m_p make_pair
#define mt make_tuple
#define str to_string

// #ifndef ONLINE_JUDGE
//     #define cerr if(false) cerr
// #endif
 
const ll mxn = 1e6;
const ll k = 400;
// const ll org = 10000;
const ll inf = 1e9 + 7;
// const ll mod = 998244353;

ll n,cnt = 0;

char a[100][100];

ll t[1000] = {0,4,3,2,1};

bool used[100][100];

vector <ll> v[mxn];

int main(){
    // freopen("sparse.in","r",stdin);
    // freopen("sparse.out","w",stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    ll tt = 1;
    // cin >> tt; 
    while(tt --){
        FOR(i,0,10){
            FOR(j,0,10){
                cin >> a[i][j];
            }
        }
        bool ch = true;
        FOR(i,0,10){
            FOR(j,0,10){
                if(used[i][j] == true) continue;
                used[i][j] = true;
                if(a[i][j] == '#'){
                    ll cnt = 1;
                    if(a[i + 1][j] == '#' && a[i][j + 1] == '#' || a[i + 1][j + 1] == '#' || a[i + 1][j - 1] == '#'){
                        ch = false;
                        break;
                    }
                    ll k = i + 1;
                    while(a[k][j] == '#'){
                        used[k][j] = true,cnt ++;
                        if(a[k][j + 1] == '#' || a[k][j - 1] == '#'){
                            ch = false;
                            break;
                        }
                        if(a[k + 1][j + 1] == '#' || a[k + 1][j - 1] == '#'){
                            // cout << k << " " << j << endl;
                            ch = false;
                            break;
                        }
                        k ++;
                    }
                    k = j + 1;
                    while(a[i][k] == '#') {
                        used[i][k] = true,cnt ++;
                        if(a[i + 1][k] == '#' || a[i - 1][k] == '#'){
                            ch = false;
                            break;
                        }
                        if(a[i + 1][k + 1] == '#' || a[i + 1][k - 1] == '#'){
                            ch = false;
                            break;
                        }
                        k ++;
                    }
                    t[cnt] --;
                    if(t[cnt] < 0){
                        ch = false;
                        break;
                    }
                }
            }
            if(ch == false) break;
        }
        FOR(i,1,5){
            if(t[i] != 0) ch = false;
            // cout << t[i] << " ";
        }
        cout << (ch == true ? "YES" : "NO") << endl;
    }
}
