#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define pb() push_back()
#define neutral 0

void setIO(string name = "") {
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
}

vector<string> v(12, "............");
vector<int> nums(11);



bool check(int i, int j){
    if(v[i][j]=='#'){
        v[i][j]='.';
        int k=1;
        if(v[i+1][j-1]=='#'){return false;}
        else if(v[i-1][j+1]=='#'){return false;}
        else if(v[i][j+1]=='#' && v[i+1][j]=='#'){return false;}
        else if(v[i][j+1]=='#'){
            v[i][j]='.'; //shetta
            k++;
            if(v[i+1][j-1]=='#' || v[i+1][j]=='#'){return false;}
            while(v[i][j+1]=='#'){
                j++;
                v[i][j]='.'; //shetta
                if(v[i+1][j+1]=='#'){return false;}
                
                k++;
            }
            k--;
            nums[k]++;
        }

        else if(v[i+1][j]=='#'){
            k++;
            v[i][j]='.'; //shetta
            if(v[i-1][j+1]=='#' || v[i][j+1]=='#'){return false;}
            while(v[i+1][j]=='#'){
                i++;
                v[i][j]='.'; //shetta
                if(v[i+1][j+1]=='#'){return false;}
                k++;
                
            }
            k--;
            nums[k]++;
        }
        else{nums[k]++;}
        return true;

    }
    else return true;
}

void solve() {
    for(int i=1; i<=10; i++){
        string s; cin>>s;
        s="."+s+".";
        v[i]=s;
    }
    // for(int i=0; i<10; i++){
    //     cout<<v[i]<<"\n";
    // }
    // cout<<"\n";
    for(int i=0;i<=11; i++){
        for(int j=0; j<=11; j++){
            // cout<<v[i][j];
            if(!check(i, j)){cout<<"NO";return;}
        }
        // cout<<"\n";
    }
    // cout<<"\n";

    // for(int i=0; i<11; i++){
    //     cout<<nums[i];
    // }

    for(int i=1; i<5; i++){
        if(nums[i]!=5-i){
            cout<<"NO";
            return;
        }
    }
    for(int i=5; i<=10; i++){
        if(nums[i]>0){cout<<"NO";return;}
    }
    cout<<"YES";


}
 
int main() {   
    auto start = chrono::high_resolution_clock::now();  
    setIO();  
    int testCases=1;
    while(testCases--){
        solve();
    }
    // #ifdef LOCAL
    // cout<<"\n\n______________________________________\n";
    // auto duration = chrono::duration_cast<chrono::microseconds>(chrono::high_resolution_clock::now() - start);
  
    //  cout << "time: " << (double)duration.count()/1000.0 << " milliseconds" << endl;
    // #endif
    
}