#include<bits/stdc++.h>

#define ll long long
#define pb push_back
#define mp make_pair
#define vec vector
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()

using namespace std;

const int MAX = 2e5 + 7;
bool us[10][10];

void fil(int x,int y){
    us[max(0,x-1)][max(0,y-1)]=true;
    us[max(0,x-1)][y]=true;
    us[max(0,x-1)][min(9,y+1)]=true;
    us[x][max(0,y-1)]=true;
    us[x][y]=true;
    us[x][min(9,y+1)]=true;
    us[min(9,x+1)][max(0,y-1)]=true;
    us[min(9,x+1)][y]=true;
    us[min(9,x+1)][min(9,y+1)]=true;
}

void solve(){
    vector<string> s(10);
    int i,j,k1=0,k2=0,k3=0,k4=0;
    for (i=0;i<10;i++)cin>>s[i];
    for (i=0;i<10;i++){
        for (j=0;j<10;j++){
            if (s[i][j]!='#')continue;
            if (us[i][j]){
                cout<<"NO";
                return;
            }
            int k=0;
            vector<int> x,y;
            if ((i==9||s[i+1][j]=='.')&&(j==9||s[i][j+1]=='.')){
                fil(i,j);
                s[i][j]='*';
                k1++;
                continue;
            }
            if (i!=9&&s[i+1][j]=='#'){
                int ii=i;
                while (ii<10&&s[ii][j]=='#'){
                    k++;
                    x.pb(ii),y.pb(j);
                    s[ii][j]='*';
                    ii++;
                }
                if (k==2)k2++;
                if (k==3)k3++;
                if (k==4)k4++;
                if (k>4){
                    cout<<"NO";
                    return;
                }
                for (int l=0;l<x.size();l++)
                    fil(x[l],y[l]);
                continue;
            }
            if (j!=9&&s[i][j+1]=='#'){
                int jj=j;
                while (jj<10&&s[i][jj]=='#'){
                    k++;
                    x.pb(i),y.pb(jj);
                    s[i][jj]='*';
                    jj++;
                }
                if (k==2)k2++;
                if (k==3)k3++;
                if (k==4)k4++;
                if (k>4){
                    cout<<"NO";
                    return;
                }
                for (int l=0;l<x.size();l++)
                    fil(x[l],y[l]);
                continue;
            }
        }
    }
    if (!(k1==4&&k2==3&&k3==2&&k4==1)){
        cout<<"NO";
        return;
    }
    cout<<"YES";
}

int main () {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    solve();
}
