#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#pragma GCC optimize("03")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx,avx2,bmi2,fma")

using namespace std;
//using namespace __gnu_pbds;

//gp_gash_table<int,int>mp;
#define ll long long
#define pb push_back
#define ld long double
#define endl '/n'
#define all(a) a.begin(), a.end()

const ll INF = 2e18, MOD = 1e9 + 7, MAXN = 2e5;

vector<int>xx = {1,1,1,0,0,-1,-1,-1};
vector<int>yy = {1,0,-1,1,-1,-1,0,1};

bool ok(int x, int y) {
    return x >= 0 && x < 10 && y >= 0 && y < 10;
}


void solve() {
    vector<string>vec(10);
    for (int i = 0; i < 10; i++) {
        cin >> vec[i];
    }
    bool fl = true;
    int r = 0;
    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            if (vec[i][j] == '#') {
                int k = 0;
                for (int z = 0; z < 8; z++) {
                    if (ok(i + xx[z], j + yy[z])) {
                        if (vec[i + xx[z]][j + yy[z]] == '#') {
                            k++;
                        }
                    }
                }
                if (k > 1) {
                    fl = true;
                }
                if (k == 0) {
                    r++;
                }
            }
        }
    }
    if (!fl || r != 4) {
        cout << "NO";
        return;
    }
    vector<vector<bool>>used(10, vector<bool>(10));
    vector<int>an(5);
    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            int x = i, y = j;
            if (vec[i][j] == '#' && !used[i][j]) {
                int k = 1;
                used[i][j] = 1;
                if (j < 9) {
                    if (vec[i][j + 1] == '#') {
                        while (vec[x][y + 1] == '#') {
                            k++;
                            used[x][y + 1] = 1;
                            y++;
                        }
                    }
                }
                y = j;
                if (x < 9) {
                    if (vec[i+1][j] == '#') {
                        while(vec[x+1][y] == '#') {
                            k++;
                            used[x + 1][y] = 1;
                            x++;
                        }
                    }
                }
                an[k]++;
            }
        }
    }
    if (an[1] == 4 && an[2] == 3 && an[3] == 2 && an[4] == 1) {
        cout << "YES";
    } else {
        cout << "NO";
    }
}

int main() {
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll t = 1;
    // cin >> t;
    while(t--) {
        solve();
    }
}