#include <iostream>
#include <vector>
using namespace std;

int main() {
    int shipCount[5];
    shipCount[1] = 4;
    shipCount[2] = 3;
    shipCount[3] = 2;
    shipCount[4] = 1;

    char grid[10][10];

    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            cin >> grid[i][j];
        }
    }

    for (int i = 0; i < 10; i++) {
        int j = 0;
        while (j < 10) {
            if (grid[i][j] == '#') {
                if (i < 9 && j < 9 && grid[i + 1][j + 1] == '#') {
                    cout << "NO";
                    return 0;
                }
                if (i < 9 && j > 0 && grid[i + 1][j - 1] == '#') {
                    cout << "NO";
                    return 0;
                }
            }
            j++;
        }
    }

    for (int i = 0; i < 10; i++) {
        int j = 0;
        while (j < 10) {
            if (grid[i][j] == '#') {
                int size = 0;
                int o = j;
                while (o < 10 && grid[i][o] == '#') {
                    size++;
                    o++;
                }
                if (size > 4) {
                    cout << "NO";
                    return 0;
                }
                if (size > 1) {
                    shipCount[size]--;
                    o = j;
                    while (o < j + size) {
                        grid[i][o] = '.';
                        o++;
                    }
                }

                size = 0;
                o = i;
                while (o < 10 && grid[o][j] == '#') {
                    size++;
                    o++;
                }
                if (size > 4) {
                    cout << "NO";
                    return 0;
                }
                if (size > 1) {
                    shipCount[size]--;
                    o = i;
                    while (o < i + size) {
                        grid[o][j] = '.';
                        o++;
                    }
                }
            }
            j++;
        }
    }

    for (int i = 0; i < 10; i++) {
        int j = 0;
        while (j < 10) {
            if (grid[i][j] == '#') {
                shipCount[1]--;
            }
            j++;
        }
    }

    bool isPossible = true;
	for (int i = 1; i <= 4; i++) {
    	if (shipCount[i] != 0) {
        	isPossible = false;
        	break;
    	}
	}

	if (isPossible) {
    	cout << "YES";
	} else {
    	cout << "NO";
	}
    return 0;
}
