#include <iostream>
#include <vector>

using namespace std;

void checkShip(vector<string>& field, int x, int y, int& size) {
    if (x < 0 || x >= 10 ||  y < 0 ||  y >= 10 || field[x][y] == '.') {
        return;
    }
    
    field[x][y] = '.';
    size++;

    checkShip(field, x - 1, y, size);
    checkShip(field, x + 1, y, size);
    checkShip(field, x, y - 1, size);
    checkShip(field, x, y + 1, size);
}

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

    vector<int> shipCount(5, 0);

    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            if (field[i][j] == '#') {
                int size = 0;
                checkShip(field, i, j, size);
                shipCount[size]++;
            }
        }
    }

    if (shipCount[1] == 4 && shipCount[2] == 3 && shipCount[3] == 2 && shipCount[4] == 1) {
        cout << "YES";
    } else {
        cout << "NO";
    }

    return 0;
}