#include <bits/stdc++.h>

#define pudge ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
//typedef tuple<ll, ll, ll> tll;

const ll INF = 2e18;
const double PI = acos(-1);
const ll MOD7 = 1e9 + (1000 - 7);
const ll MOD9 = 1e9 + 9;
const ll P = 31;
const ld E = 1e-6;
//const ll N = 6250001;
const ll N = 1000006;

vector<pll> way = {{1,  0},
                   {0,  1},
                   {-1, 0},
                   {0,  -1}};
vector<pll> way_exit = {{1,  1},
                        {-1, 1},
                        {-1, -1},
                        {1,  -1}};

vector<ll> col;

void check(ll x, ll y, vector<string> &map, vector<vector<bool>> &used, ll len = 1) {
    used[x][y] = true;
    ll cnt = 0;
    for (auto [dx, dy]: way_exit) {
        x += dx;
        y += dy;
        if (x < 10 && x >= 0 && y < 10 && y >= 0) {
            if (map[x][y] == '#') {
                cout << "NO\n";
                exit(0);
            }
        }
        x -= dx;
        y -= dy;
    }
    for (auto [dx, dy]: way) {
        x += dx;
        y += dy;
        if (x < 10 && x >= 0 && y < 10 && y >= 0) {
            if (map[x][y] == '#' && !used[x][y]) {
                ++cnt, check(x, y, map, used, len + 1);
            }
            if (cnt > 1) {
                cout << "NO\n";
                exit(0);
            }
        }
        x -= dx;
        y -= dy;
    }
    if (cnt == 0)
        col[len]++;
}

int main() {
    pudge;

//    freopen("minmax.in", "r", stdin);
//    freopen("minmax.out", "w", stdout);

    vector<string> map(10);
    vector<pll> resh;
    col.resize(5, 0);
    vector<vector<bool>> used(10, vector<bool>(10, false));
    for (int i = 0; i < 10; ++i) {
        cin >> map[i];
        for (int j = 0; j < 10; ++j)
            if (map[i][j] == '#')
                resh.emplace_back(i, j);
    }
    for (auto [x, y]: resh)
        if (!used[x][y])
            check(x, y, map, used);
    if (col[4] == 1 && col[3] == 2 && col[2] == 3 && col[1] == 4)
        cout << "YES\n";
    else
        cout << "NO\n";
    return 0;
}
