#include <bits/stdc++.h>
using namespace std;
#define pi pair<int,int>
#define ll long long
#define ld long double
#define bg begin()
#define nd end()
#define sz size()
#define ers erase
#define ff first
#define ss second

ll binpow(ll a, ll x) {
    if (!x)
        return 1 ;
    if (x & 1)
        return a * binpow(a, x - 1) ;
    ll p = binpow(a, x / 2) ;
        return (p * p) ;
}

const int MAXN = (1 << 18) ;
const int INF = INT_MAX ;

char a[15][15] ;
bool us[15][15] ;
int k ;

void dfs(int i, int j) {
    ++k ;
    us[i][j] = 1 ;
    if (a[i + 1][j + 1] == '#' || a[i - 1][j - 1] == '#' || a[i - 1][j + 1] == '#' || a[i + 1][j - 1] == '#') {
        cout << "NO" ;
        exit(0) ;
    }
    if ( i - 1 > 0 && a[i - 1][j] == '#' && !us[i - 1][j])
        dfs(i - 1, j) ;
    if (i + 1 <= 10 && a[i + 1][j] == '#' && !us[i + 1][j])
        dfs(i + 1, j) ;
    if (j - 1 > 0 && a[i][j - 1] == '#' && !us[i][j - 1]) 
        dfs(i, j - 1) ;
    if (j + 1 <= 10 && a[i][j + 1] == '#' && !us[i][j + 1])
        dfs(i, j + 1) ;
}

int main() {
//freopen("input.in", "r", stdin) ;
//freopen("output.out", "w", stdout) ;
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    for (int i = 1; i <= 10; ++i)
        for (int j = 1;  j <= 10; ++j)
            cin >> a[i][j] ;
    int a1, b, c, d, e ;
    a1 = b = c = d = e = 0 ;
    for (int i = 1; i <= 10; ++i) {
        for (int j = 1; j <= 10; ++j) {
            k = 0 ;
            if (!us[i][j] && a[i][j] == '#') {
                dfs(i, j) ;
                if (k == 1)
                    ++a1 ;
                else if (k == 2)
                    ++b ;
                else if (k == 3)
                    ++c ;
                else if (k == 4)
                    ++d ;
                else ++e ;
            }
        }
    }
    if (a1 == 4 && b == 3 && c == 2 && d == 1 && e == 0)
        cout << "YES" ;
    else cout << "NO" ;
}