#include <bits/stdc++.h>
using namespace std;
int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    vector <vector<char>> a(10,vector<char>(10));
    for(int i=0;i<10;i++) for(int j=0;j<10;j++) cin>>a[i][j];
    bool ok1=true;
    map <int,int> mp{{1,0},{2,0},{3,0},{4,0}};
    for(int i=0;i<10;i++){
        for(int j=0;j<10;j++){
            if(a[i][j]!='#') continue;
            if(i!=0 and j!=0) if(a[i-1][j-1]=='#') ok1=false;
            if(i!=0 and j!=9) if(a[i-1][j+1]=='#') ok1=false;
            if(i!=9 and j!=0) if(a[i+1][j-1]=='#') ok1=false;
            if(i!=9 and j!=9) if(a[i+1][j+1]=='#') ok1=false;
        }
    }
    for(int i=0;i<10;i++){
        bool was=false;
        int count=0;
        for(int j=0;j<10;j++){
            if(a[i][j]=='#' and was==true) count++;
            if(a[i][j]=='#' and was==false){
                was=true;
                count++;
            }
            if((a[i][j]!='#' and was==true) or (a[i][j]=='#' and j==9)){
                was=false;
                if(count>4) ok1=false;
                else if(count>1){
                    mp[count]++;
                }
                count=0;
            }
        }
    }
    for(int j=0;j<10;j++){
        bool was=false;
        int count=0;
        for(int i=0;i<10;i++){
            if(a[i][j]=='#' and was==true) count++;
            if(a[i][j]=='#' and was==false){
                was=true;
                count++;
            }
            if((a[i][j]!='#' and was==true) or (a[i][j]=='#' and j==9)){
                was=false;
                if(count>4) ok1=false;
                else if(count>1){
                    mp[count]++;
                }
                count=0;
            }
        }
    }
    for(int i=0;i<10;i++){
        for(int j=0;j<10;j++){
            if(a[i][j]=='#'){
                bool one=true;
                if(i!=0 and a[i-1][j]=='#') one=false;
                if(i!=9 and a[i+1][j]=='#') one=false;
                if(j!=0 and a[i][j-1]=='#') one=false;
                if(j!=9 and a[i][j+1]=='#') one=false;
                if(one) mp[1]++;
            }
        }
    }

    bool ok2 = false;
    if(mp[1] == 4 && mp[2] == 3 && mp[3] == 2 && mp[4] == 1) {
        ok2 = true;
    }

    if (ok1 == true && ok2 == true) {
        cout << "YES";
    }
    else {
        cout << "NO";
    }
    return 0;
}
