#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
    ios_base::sync_with_stdio(false);
    string a[10];
    for(int i = 0; i < 10; i++){
        cin>>a[i];
    }
    for(int i = 0; i < 10; i++){
        for(int j = 0; j < 10; j++){
            if(a[i][j] == '#'){
                if(i != 9 and j != 9 and a[i+1][j+1] == '#'){
                    cout<<"NO";
                    return 0;
                }else if(i != 0){
                   if(a[i-1][j+1] == '#'){
                      cout<<"NO";
                      return 0;
                   }
                }else if(i != 0 and j != 0){
                    if(a[i-1][j-1] == '#'){
                      cout<<"NO";
                      return 0;
                   }
                }else if(j != 0){
                   if(a[i+1][j-1] == '#'){
                      cout<<"NO";
                      return 0;
                   }
                }
            }
        }
    }cout<<"YES";
    return 0;
}