#include <bits/stdc++.h>

#define mp make_pair
#define ull unsigned long long
#define ll long long
#define forn(i, n) for(int i = 0; i < n; i++)
using namespace std;

int im[10][10];
void start() {
    int n = 10;
    int arr[5] = {0, 4, 3, 2, 1};
    char mat[n][n];
    forn(i, n) forn(j, n) cin >> mat[i][j];

    forn(i, 10) {
        forn(j, 10) {
            if (mat[i][j] == '#') {
                if (i > 0 && j > 0 && mat[i - 1][j - 1] == '#') {
                    cout << "NO" << "\n";
                    return;
                } 
                if (i < 9 && j < 9 && mat[i + 1][j + 1] == '#') {
                    cout << "NO" << "\n";
                    return;
                } 
                if (i < 9 && j > 0 && mat[i + 1][j - 1] == '#') {
                    cout << "NO" << "\n";
                    return;
                }
                if (i > 0 && j < 9 && mat[i - 1][j + 1] == '#') {
                    cout << "NO" << "\n";
                    return;
                }
            }
        }
    }

    forn(i, 10) {
        forn(j, 10) {
            if (mat[i][j] == '#' && im[i][j] != 1) {
                int cnt1 = 1;
                for(int di = 1; di <= 4; di++) {
                    if (i + di < 10 && mat[i + di][j] == '#') {
                        cnt1++;
                        im[i + di][j] = 1; 
                    }
                    else break;
                }
                if (cnt1 > 4) {
                    cout << "NO" << "\n";
                    return;
                }

                int cnt2 = 1;
                for(int dj = 1; dj <= 4; dj++) {
                    if (j + dj < 10 && mat[i][j + dj] == '#') {
                        cnt2++;
                        im[i][j + dj] = 1;
                    }
                    else break;
                }
                if (cnt2 > 4) {
                    cout << "NO" << "\n";
                    return;
                }
                arr[max(cnt1, cnt2)]--;
            }
        }
    }

    forn(i, 5) {
        if (arr[i] != 0) {
            cout << "NO" << "\n";
            return;
        }
    }

    cout << "YES" << "\n";
}

int main() {
    int t = 1;
    //cin >> t;
    while(t--)
        start();
}