#include <bits/stdc++.h>
using namespace std;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    vector<long long> counts(4);
    long long numRows = 10, numCols = 10;
    vector<vector<long long>> grid(50, vector<long long>(50));

    for (long long i = 1; i <= numRows; i++) {
        for (long long j = 1; j <= numCols; j++) {
            char cell;
            cin >> cell;
            grid[i][j] = cell == '#';
        }
    }

    for (long long y = 0; y < counts.size(); y++) {
        long long x = y + 1;
        long long blockSize = x + 2;

        for (long long i = 1; i <= numRows; i++) {
            for (long long j = 0; j <= numCols; j++) {
                bool valid = true;
                for (long long k = 0; k < blockSize; k++) {
                    if (grid[i - 1][j + k] || grid[i + 1][j + k])
                        valid = false;
                }
                if (grid[i][j] || grid[i][j + x + 1])
                    valid = false;
                for (long long k = 1; k + 1 < blockSize; k++) {
                    if (!grid[i][j + k])
                        valid = false;
                }
                if (valid) {
                    for (long long k = 1; k + 1 < blockSize; k++) {
                        grid[i][j + k] = 0;
                    }
                    counts[y]++;
                }
            }
        }
    }

    for (long long y = 0; y < counts.size(); y++) {
        long long x = y + 1;
        long long blockSize = x + 2;

        for (long long i = 0; i <= numRows; i++) {
            for (long long j = 1; j <= numCols; j++) {
                bool valid = true;
                for (long long k = 0; k < blockSize; k++) {
                    if (grid[i + k][j - 1] || grid[i + k][j + 1])
                        valid = false;
                }
                if (grid[i][j] || grid[i + x + 1][j])
                    valid = false;
                for (long long k = 1; k + 1 < blockSize; k++) {
                    if (!grid[i + k][j])
                        valid = false;
                }
                if (valid) {
                    counts[y]++;
                }
            }
        }
    }

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