#include <bits/stdc++.h>
#define ll long long
#define fr first
#define sc second
#define ll long long int
#define ld long double
#define mup unordered_map
#define pb push_back
#define pf push_front
#define fr first
#define sc second
#define NeedForSpeed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);srand(time(0)) ;
#define p_b pop_back
#define p_f pop_front
#define quluq return 0;
#define NO cout << "NO\n"
#define no cout << "no\n"
#define No cout << "No\n"
#define Yes cout << "Yes\n"
#define YES cout << "YES\n"
#define yes cout << "yes\n"
using namespace std;
void flfl() {
    int q = 0 , w = 0 ;
    string s[10] , ans = "YES" ;
    int ar[10][10] = {} ;
    for ( int i = 0 ; i<10 ; i ++ )
        cin >> s[i] ;
    for ( int i = 0 ; i<10 ; i ++ ) {
        for ( int j = 0 ; j<10 ; j ++ ) {
            if ( ar[i][j] == 1 )
                continue ;
            if ( s[i][j] == '#' ) {
                q = 0 ;
                w = 0 ;
                for ( int p = j ; p<10 ; p ++ ) {
                    if ( s[i][p] == '#' )
                        q ++ ;
                    else
                        break ;
                    if ( q > 1 ) {
                        if ( i > 0 ) {
                            if ( p > 0 && s[i-1][p-1] == '#' ) {
                                NO ;
                                return ;
                            }
                            if ( s[i-1][p] == '#' ) {
                                NO ;
                                return ;
                            }
                            if ( p < 9 && s[i-1][p+1] == '#') {
                                NO ;
                                return ;
                            }
                        }
                        if ( i < 9 ) {
                            if ( p > 0 && s[i+1][p-1] == '#' ) {
                                NO ;
                                return ;
                            }
                            if ( s[i+1][p] == '#' ) {
                                NO ;
                                return ;
                            }
                            if ( p < 9 && s[i+1][p+1] == '#') {
                                NO ;
                                return ;
                            }
                        }
                    }
                }
                for ( int p = i ; p<10 ; p ++ ) {
                    if ( s[p][j] == '#' )
                        w ++ ;
                    else
                        break ;
                    if ( w > 1 ) {
                        if ( j>0 ) {
                            if ( p>0 && s[p-1][j-1] == '#' ) {
                                NO ;
                                return ;
                            }
                            if ( s[p][j-1] == '#' ) {
                                NO ;
                                return ;
                            }
                            if ( p<9 && s[p+1][j-1] == '#' ) {
                                NO ;
                                return ;
                            }
                        }
                        if ( j<9 ) {
                            if ( p>0 && s[p-1][j+1] == '#' ) {
                                NO ;
                                return ;
                            }
                            if ( s[p][j+1] == '#' ) {
                                NO ;
                                return ;
                            }
                            if ( p<9 && s[p+1][j+1] == '#' ) {
                                NO ;
                                return ;
                            }
                        }
                    }

                }
                if ( q > 1 && w > 1 ) {
                    NO ;
                    return ;
                }
            }
        }
    }
    YES ;
}

int main() {
    NeedForSpeed
    int t = 1 ;
    while ( t -- ) {
        flfl() ;
    }
}
