#include <iostream>
#include <vector>

using namespace std;

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

    vector<int> shipSizes = {4, 3, 3, 2, 2, 2, 1, 1, 1, 1};
    vector<int> shipCount(10, 0);

    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            if (field[i][j] == '#') {
                // Check horizontally
                int len = 0;
                while (j < 10 && field[i][j] == '#') {
                    len++;
                    j++;
                }
                if (len > 0) {
                    for (int k = 0; k < 10; k++) {
                        if (shipSizes[k] == len) {
                            shipCount[k]++;
                            break;
                        }
                    }
                }

                // Check vertically
                len = 0;
                j = i;
                while (j < 10 && field[j][i] == '#') {
                    len++;
                    j++;
                }
                if (len > 0) {
                    for (int k = 0; k < 10; k++) {
                        if (shipSizes[k] == len) {
                            shipCount[k]++;
                            break;
                        }
                    }
                }
            }
        }
    }

    for (int i = 0; i < 10; i++) {
        if (shipCount[i] != i + 1) {
            cout << "NO" << endl;
            return 0;
        }
    }

    cout << "YES" << endl;

    return 0;
}