#include <bits/stdc++.h>
#define int long long
#define ll long long
#define str string
#define ld long double
#define run_vasya_run ios_base::sync_with_stdio(0) , cin.tie(0) ,cout.tie(0)
#define uint unsigned long long
#define fi first
#define se second
#define pb push_back
#define open freopen ("log.in", "r", stdin);
#define close freopen("log.out", "w", stdout);
using namespace std;
const int MOD = 10000000007;
ll _;
char a[20][20];
map<ll,ll>us;
vector<ll>ans;
bool ch(ll i, ll j)
{
    if(a[i + 1][j + 1] == '#')
    {
        return false;
    }
    if(a[i + 1][j - 1] == '#')
    {
        return false;
    }
    if(a[i - 1][j + 1] == '#')
    {
        return false;
    }
    if(a[i - 1][j - 1] == '#')
    {
        return false;
    }
    return true;
}
main()
{
    //run_vasya_run;
    _ = 1;
    //open;
    //close;
    //cin >> _;
    while(_ --)
    {
        bool ok = false;
        for(int i = 1; i <= 10; i ++)
        {
            for(int j = 1; j <= 10; j ++)
            {
                cin >> a[i][j];
            }
        }
        map<ll,ll>us;
        ll sum2 = 0;
        for(ll i = 1; i <= 10; i++)
        {
            for(ll j = 1; j <= 10; j++)
            {
                if(a[i][j] == '#')
                {
                    ll sum = 0;
                    ll p = i, p2 = j;
                    a[i][j] = '.';
                    while(true)
                    {
                        ll o = 0;
                        if(ch(p, p2) == 0)
                        {
                            cout << "NO" << '\n';
                            return 0;
                        }
                        if(a[p][p2 + 1] == '#')
                        {
                            o ++;
                            p2 ++;
                            a[p][p2] = '.';
                        }
                        if(a[p + 1][p2] == '#')
                        {
                            o ++;
                            p ++;
                            a[p][p2] = '.';
                        }
                        if(a[p - 1][p2] == '#')
                        {
                            o ++;
                            p --;
                            a[p][p2] = '.';
                        }
                        if(a[p][p2 - 1] == '#')
                        {
                            o ++;
                            p2 --;
                            a[p][p2] = '.';
                        }
                        if(o > 1){
                            cout << "NO" << '\n';
                            return 0;
                        }
                        sum ++;
                        if(o == 0){
                            break;
                        }
                    }
                    us[sum] ++;
                }
            }
        }
        for(auto to : us){
            if(to.fi > 4){
                cout << "NO" << '\n';
                return 0;
            }
            if(4 - to.fi + 1 != to.se){
                cout << "NO" << '\n';
                return 0;
            }
        }
        cout << "YES" << '\n';
        return 0;
        ///// 4 - palubnik
    }
}
