#include <iostream>
#include <vector>

using namespace std;

bool is_valid_ship_placement(const vector<string>& field) {
    vector<int> ship_sizes = {4, 3, 3, 2, 2, 2, 1, 1, 1, 1};
    vector<vector<bool>> visited(10, vector<bool>(10, false));

    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            if (visited[i][j] || field[i][j] == '.') continue;

            int size = 0;
            int x = i;
            int y = j;

            while (x < 10 && field[x][j] == '#') {
                size++;
                visited[x][j] = true;
                x++;
            }

            while (y < 10 && field[i][y] == '#') {
                size++;
                visited[i][y] = true;
                y++;
            }

            if (size != ship_sizes.back()) {
                return false;
            }

            ship_sizes.pop_back();
        }
    }

    return ship_sizes.empty();
}

int main() {
    vector<string> field(10);
    for (int i = 0; i < 10; i++) {
        cin >> field[i];
    }

    if (is_valid_ship_placement(field)) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }

    return 0;
}