// by Diar Esbol
#include <iostream>
#include <cmath>
#include <climits>
#include <set>
#include <map>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <queue>
#include <numeric>
#include <stack>
#include <assert.h>
 
using namespace std;
 
#define ll long long
#define ld long double
#define pb push_back
#define pop_b pop_back
#define all(x) x.begin(), x.end()
#define ull unsigned long long
 
const ll maxv = 15, mod = 1e9 + 7, inf = 2e9;
 
void booster( ) {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}
ll binpow(ll a, ll b) {
    if (b == 0) {
        return 1;
    }
    if (b % 2) {
        return binpow(a, b - 1) * 1LL * a % mod;
    }
    ll res = binpow(a, b / 2);
    return res * 1LL * res % mod;
}
ll lcm(ll a, ll b) {
    return abs(a * b) / gcd(a, b);
}

char c[maxv][maxv];
 
void solve( ){
    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j ++) {
            cin >> c[i][j];
        }
    }
    
    for (int i = 0; i < 10; i ++) {
        for (int j = 0; j < 10; j ++) {
            if (c[i][j] == '#') {
                if (c[i + 1][j + 1] == '#' or c[i - 1][j + 1] == '#' or c[i + 1][j - 1] == '#' or c[i - 1][j - 1] == '#') {
                    cout << "NO\n";
                    return;
                }
                if ((c[i + 1][j] == '#' and c[i][j + 1] == '#') or (c[i - 1][j] == '#' and c[i][j - 1] == '#') or (c[i - 1][j] == '#' and c[i][j + 1] == '#') or (c[i + 1][j] == '#' and c[i][j - 1] == '#')) {
                    cout << "NO\n";
                    return;
                }
            }
        }
    }
    
    int x = 0, xd = 0;
    for (int i = 0; i < 10; i ++) {
        for (int j = 0; j < 10 ; j ++) {
            if (c[i][j] == '#' and c[i][j] == c[i + 1][j] and c[i][j] == c[i + 2][j] and c[i][j] == c[i + 3][j]) {
                c[i][j] = '.';
                c[i + 1][j]= '.';
                c[i + 2][j] = '.';
                c[i + 3][j] = '.';
                xd ++;
                break;
            }
            if (c[i][j] == '#' and c[i][j] == c[i][j + 1] and c[i][j] == c[i][j + 2] and c[i][j] == c[i][j + 3]) {
                c[i][j] = '.';
                c[i][j + 1]= '.';
                c[i][j + 2] = '.';
                c[i][j + 3] = '.';
                xd ++;
                break;
            }
        }
    }
    for (int i = 0; i < 10; i ++) {
        for (int j = 0; j < 10; j ++) {
            if (c[i][j] == '#' and c[i][j] == c[i + 1][j] and c[i][j] == c[i + 2][j]) {
                c[i][j] = '.';
                c[i + 1][j]= '.';
                c[i + 2][j] = '.';
                x ++;
                if (x > 2) {
                    break;
                }
            }
            if (c[i][j] == '#' and c[i][j] == c[i][j + 1] and c[i][j] == c[i][j + 2]) {
                c[i][j] = '.';
                c[i][j + 1] = '.';
                c[i][j + 2] = '.';
                x ++;
                if (x > 2) {
                    break;
                }
            }
        }
    }
    
    int de = 0;
    for (int i = 0; i < 10; i ++) {
        for (int j = 0; j < 10; j ++) {
            if (c[i][j] == '#' and c[i][j] == c[i + 1][j]) {
                c[i][j] = '.';
                c[i + 1][j] = '.';
                de ++;
                if(de > 3) {
                    break;
                }
            }
            if (c[i][j] == '#' and c[i][j] == c[i][j + 1]) {
                c[i][j] = '.';
                c[i][j + 1] = '.';
                de ++;
                if (de > 3) {
                    break;
                }
            }
        }
    }
    int v = 0;
    for (int i = 0; i < 10; i ++) {
        for (int j = 0; j < 10; j ++) {
            if (c[i][j] == '#' and c[i][j] == c[i + 1][j]) {
                c[i][j] = '.';
                c[i + 1][j] = '.';
                v ++;
                if(v > 3) {
                    break;
                }
            }
            if (c[i][j] == '#') {
                c[i][j] = '.';
                v ++;
                if (v > 3) {
                    break;
                }
            }
            
        }
    }
    
    if (xd == 1 and x == 2 and de == 3 and v == 4) {
        cout << "YES\n";
    }
    else {
        cout << "NO\n";
    }
}
int main( ) {
    booster( );
    int testcases = 1;
    //cin >> testcases;
    while (testcases --) {
        solve( );
    }
}
