///@CodeByUsmonjk@
#include<bits/stdc++.h>
#define ll long long
#define ul unsigned long long
#define in short int
#define fr first
#define sc second
#define mpl map<ll , ll>
#define mps map<ll , string>
#define mpc map<ll , char>
#define vl vector<ll>
#define vs vector<string>
#define vc vector<char>
#define pb push_back
#define vpl vector<pair<ll , ll>>
#define out cout<<
#define in cin>>
#define en '\n'
#define ios ios_base::sync_with_stdio(0) ; cin.tie(0) ;
using namespace std;

ll a,b,c,d,e,f,g,h,n,n1,n2,n3,n4,cnt,ans,pz ,mx ,mx1 ,mx2 ,mx3 ,mn=1e9 ,mn1=1e9 ,mn2=1e9 ,mn3=1e9;
long double aa,bb,cc,dd,ee,ff,gg,hh;
string s,s1,s2,s3,ss;

map<pair<ll , ll> , ll>mp;
const ll inf=1e5;
vector<ll>v[inf];
char arr[10][10];

void dfs(ll i1 , ll j1)
{
    mp[{i1 , j1}]++;
    if(i1!=0 and arr[i1-1][j1]=='#' and mp[{i1-1 , j1}]==0 )
    {
        cnt++;
        dfs(i1-1 , j1);
    }
    if(i1!=9 and arr[i1+1][j1]=='#' and mp[{i1+1 , j1}]==0)
    {
        cnt++;
        dfs(i1+1 , j1);
    }
    if(j1!=0 and arr[i1][j1-1]=='#' and mp[{i1 , j1-1}]==0)
    {
        cnt++;
        dfs(i1 , j1-1);
    }
    if(j1!=9 and arr[i1][j1+1]=='#' and mp[{i1 , j1+1}]==0)
    {
        cnt++;
        dfs(i1 , j1+1);
    }
}

void solve()
{
    bool no=0;
    for(ll i=0; i<10; i++)
    {
        for(ll j=0; j<10; j++)
        {
            in arr[i][j];
        }
    }
    mpl pm;
    pm[4]=1;
    pm[3]=2;
    pm[2]=3;
    pm[1]=4;
    for(ll i=0; i<10; i++)
    {
        for(ll j=0; j<10; j++)
        {
            if(arr[i][j]=='#' and mp[ {i , j} ]==0 )
            {
                cnt=1;
                dfs(i , j);
                if(cnt>4)
                {
                    no=1;
                    out "NO";
                    return ;
                }
                pm[cnt]--;
                if(pm[cnt]<0)
                {
                    out "NO";
                    return ;
                }
                if(arr[i-1][j-1]=='#' and i-1>0 and j-1>0)
                {
                    out "NO";
                    return;
                }
                if(arr[i+1][j-1]=='#' and i+1!=10 and j-1>0)
                {
                    out "NO";
                    return ;
                }
                if(arr[i+1][j+1]=='#' and i+1!=10 and j+1!=10)
                {
                    out "NO";
                    return;
                }
                if(arr[i-1][j+1]=='#' and i-1>0 and j+1!=10)
                {
                    out"NO";
                    return ;
                }
            }
        }
    }
    out "YES";
    return ;
}

int main()
{
    ios
    ll t=1;
    ///cin>>t;
    while(t--)
    {
        solve();
    }
}

/***

92183747213987412123
2
22
44

***/







