#include <iostream>
#include <vector>

bool isShipValid(const std::vector<std::string>& matrix, int row, int col, int length, bool isVertical) {
    if (isVertical) {
        for (int i = row; i < row + length; i++) {
            if (i >= matrix.size() || matrix[i][col] != '#') {
                return false;
            }
        }
    } else {
        for (int j = col; j < col + length; j++) {
            if (j >= matrix[0].size() || matrix[row][j] != '#') {
                return false;
            }
        }
    }
    return true;
}

bool areShipsValid(const std::vector<std::string>& matrix) {
    const int rows = matrix.size();
    const int cols = matrix[0].size();
    const std::vector<int> shipLengths = {4, 3, 3, 2, 2, 2, 1, 1, 1, 1};

    for (int row = 0; row < rows; row++) {
        for (int col = 0; col < cols; col++) {
            if (matrix[row][col] == '#') {
                for (int length : shipLengths) {
                    if (col + length <= cols && isShipValid(matrix, row, col, length, false)) {
                        // Horizontally placed ship
                        for (int j = col; j < col + length; j++) {
                            if (matrix[row][j] != '#') {
                                return false;
                            }
                        }
                    } else if (row + length <= rows && isShipValid(matrix, row, col, length, true)) {
                        // Vertically placed ship
                        for (int i = row; i < row + length; i++) {
                            if (matrix[i][col] != '#') {
                                return false;
                            }
                        }
                    }
                }
            }
        }
    }
    return true;
}

int main() {
    std::vector<std::string> matrix;

    for (int i = 0; i < 10; i++) {
        std::string row;
        std::cin >> row;
        matrix.push_back(row);
    }

    if (areShipsValid(matrix)) {
        std::cout << "YES" << std::endl;
    } else {
        std::cout << "NO" << std::endl;
    }

    return 0;
}
