#include <bits/stdc++.h>
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)
#define int long long
using namespace std;
const int NN=1e3+60,N=1e6+70,MOD=1e9+7,inf=1e18+7,pr=420;
int n,m;
char a[NN][NN];//[NN];
//vector<int> g[N];
int binpow(int n,int m){
    if (!m) return 1;
    if (!m%2){ int a=binpow(n,m/2); return a*a;}
    else return n*binpow(n,m-1);
}
void junk(){
    n=10;
    for(int i=0;i<=n+1;i++){
        for(int j=0;j<=n+1;j++){
            a[i][j]='.';
        }
    }
    int boat=0;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            cin>>a[i][j];
            if (a[i][j]=='#'){
                boat++;
            }
        }
    }int one,two,te,fr;
    if(boat!=20){
        cout<<"NO\n";
        return;
    }
    for(int i=1;i<=n;i++){
        int cnt=0;
        for(int j=1;j<=n;j++){
            if (cnt>4){
                cout<<"NO\n";
                return;
            }
            if (a[i][j]=='#'){
                cnt++;
            }else{
                cnt=0;
            }
        }
        if (cnt>4){
            cout<<"NO\n";
            return;
        }
    }
    for(int i=1;i<=n;i++){
        int cnt=0;
        for(int j=1;j<=n;j++){
            if (cnt>4){
                cout<<"NO\n";
                return;
            }
            if (a[j][i]=='#'){
                cnt++;
            }else{
                cnt=0;
            }
        }
        if (cnt>4){
            cout<<"NO\n";
            return;
        }
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=n;j++){
            if(a[i][j]=='#'){
                int up=(a[i+1][j]=='#'),dn=(a[i-1][j]=='#'),lf=(a[i][j-1]=='#'),rg=(a[i][j+1]=='#');
                int ul=(a[i+1][j-1]=='#'),ur=(a[i+1][j+1]=='#'),dl=(a[i-1][j-1]=='#'),dr=(a[i-1][j+1]=='#');
                if (ul || ur || dl || dr){
                    cout<<"NO\n";
                    return;;
                }
                if (lf && rg){
                    if(dn || up){
                        cout<<"NO\n";
                        return;
                    }
                }
                if (dn && up){
                    if(lf || rg){
                        cout<<"NO\n";
                        return;
                    }
                }
                if (lf || rg){
                    if(up || dn){
                        cout<<"NO\n";
                        return;
                    }
                }
                if (dn || up){
                    if(rg || lf){
                        cout<<"NO\n";
                        return;
                    }
                }
            }
        }
    }cout<<"YES\n";
    
}
signed main(/*ITS OVER ANAKIN. I HAVE A HIGH GROUND*/){//file("");
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int Test=1;//cin>>Test;
while(Test--) junk();
/*YOU UNDERESTIMATE MY POWER*/
}