#include <iostream>
#include <vector>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("avx2")

vector<vector<char>> field;
vector<vector<char>> vistd;

struct cell {
    int i = 0;
    int j = 0;
    cell() = default;
    cell(int i, int j): i(i), j(j) {}
    cell(const cell& c): i(c.i), j(c.j) {}
};

void unit(pair<cell, cell>& ret, pair<cell, cell> res) {
    if (res.first.i < ret.first.i) ret.first.i = res.first.i;
    if (res.first.j < ret.first.j) ret.first.j = res.first.j;
    if (res.second.i > ret.second.i) ret.second.i = res.second.i;
    if (res.second.j > ret.second.j) ret.second.j = res.second.j;
}

pair<cell, cell> dfs(int i, int j) {
    vistd[i][j] = 1;
//    cout << "(" << i << ", " << j << ")\n";
    pair<cell, cell> ret = {cell(i, j), cell(i, j)};
//    return ret;
    for (int ix = -1; ix <= 1; ++ix) {
        if (ix == 0) continue;
        if (0 <= i + ix && i + ix < 10 && (field[i + ix][j] != '.') && (!vistd[i + ix][j])) {
            unit(ret, dfs(i + ix, j));
        }
    }
    for (int jx = -1; jx <= 1; ++jx) {
        if (jx == 0) continue;
        if (0 <= j + jx && j + jx < 10 && (field[i][j + jx] != '.') && (!vistd[i][j + jx])) {
            unit(ret, dfs(i, j + jx));
        }
    }
    return ret;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    for (int i = 0; i < 10; ++i) {
        field.push_back({});
        vistd.push_back({});
        for (int j = 0; j < 10; ++j) {
            char c;
            cin >> c;
            field[i].push_back(c);
            vistd[i].push_back(0);
        }
    }
    vector<pair<cell, cell>> str;
    for (int i = 0; i < 10; ++i) {
        for (int j = 0; j < 10; ++j) {
            if (field[i][j] == '#') {
                if (i != 0 && j != 0 && field[i - 1][j - 1] == '#') {
                    cout << "NO\n";
                    return 0;
                }
                if (i != 9 && j != 0 && field[i + 1][j - 1] == '#') {
                    cout << "NO\n";
                    return 0;
                }
                if (i != 0 && j != 9 && field[i - 1][j + 1] == '#') {
                    cout << "NO\n";
                    return 0;
                }
                if (i != 9 && j != 9 && field[i + 1][j + 1] == '#') {
                    cout << "NO\n";
                    return 0;
                }
            }
            if (field[i][j] == '#' && !vistd[i][j]) {
                str.push_back(dfs(i, j));
            }
        }
    }

    vector<int> q = {0, 0, 0, 0};
    for (auto x : str) {
        cell c1(x.first);
        cell c2(x.second);
//        cout << "(" << c1.i << ", " << c1.j << ") / (" << c2.i << ", " << c2.j << ")\n";
        if (c1.i != c2.i && c1.j != c2.j) {
            cout << "NO\n";
            return 0;
        }
        int sz = (c2.i - c1.i + 1) * (c2.j - c1.j + 1);
//        cout << sz << endl;
        if (sz > 4) {
            cout << "NO\n";
            return 0;
        }
        ++q[sz - 1];
    }
    if (q[0] == 4 && q[1] == 3 && q[2] == 2 && q[3] == 1) cout << "YES\n";
    else cout << "NO\n";
    return 0;
}
/*
#.#.......
.......##.
.#..#.....
.#........
.#..##....
..........
####...#..
.......#..
.......#..
##........
*/
