#include <bits/stdc++.h>

using namespace std;

vector<vector<int> > color(12,vector<int>(12,0));

bool flag = true;
vector<int> kor(4,0);

void dfs(int i, int j, vector<vector<char> >& graph, int& k){

    color[i][j]=1;
    k++;
    if (graph[i+1][j+1]=='#' || graph[i-1][j+1]=='#' || graph[i+1][j-1]=='#' || graph[i-1][j-1]=='#' ){
        flag = false;
        return;
    }
    if(graph[i+1][j]=='#' &&  color[i+1][j]==0){
        dfs(i+1,j,graph,k);

    }
    if(graph[i-1][j]=='#' && color[i-1][j]==0){
        dfs(i-1,j,graph,k);
    }
    if(graph[i][j+1]=='#' && color[i][j+1]==0){
        dfs(i,j+1,graph,k);
    }
    if(graph[i][j-1]=='#' && color[i][j-1]==0){
        dfs(i,j-1,graph,k);
    }
    color[i][j]=2;


}



int main()
{
    vector<vector<char> > graph(12);
    for(int i = 0; i<12; i++){
        graph[0].push_back('.');
    }
    for(int i = 0; i<10; i++){
        graph[i+1].push_back('.');
        string st;
        cin >> st;
        for(auto j:st){
            graph[i+1].push_back(j);
        }
        graph[i+1].push_back('.');

    }
    for(int i = 0; i<12; i++){
        graph[11].push_back('.');
    }

    /*
    for(auto i:graph){
        for(auto j: i){
            cout<<j;
        }
        cout<<endl;
    }
    */




    for(int i = 1; i<11; i++){
        for(int j = 1; j<11; j++){
            if(color[i][j]==0 && graph[i][j]=='#'){
                int k = 0;
                dfs(i,j,graph,k);
                kor[k-1]++;



            }


        }
    }



    if (kor[0]==4 && kor[1]==3 && kor[2]==2 && kor[3]==1 && flag==true){
        cout<<"YES";
    }else{
        cout<<"NO";
    }

    return 0;
}
