#include <iostream>

using namespace std;

int a[16][16];

int main()
{
   ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int cnt = 0;
    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            char c;
            cin >> c;
            if(c == '#') {
                a[i][j] = 1;
                cnt++;
            } else {
                a[i][j] = 0;
            }
        }
    }
    if (cnt != 20) {
        cout << "NO";
        return 0;
    }
    for (int i = 1; i < 9; i++) {
        for (int j = 1; j < 9; j++) {
        if(a[i][j] == 1 && (a[i + 1][j + 1] || a[i + 1][j - 1] || a[i - 1][j + 1] || a[i - 1][j - 1])){
            cout << "NO";
            return 0;
        }
        }
    }
    cout << "YES";
    return 0;
}
