/*
   Author:Man_Ray
   For:nFactorial School
   Time: 17:19

*/

#include <bits/stdc++.h>
#define forn(i,l,r,x) for(int i=(l);i<=(r);i+=x)
#define forr(i,l,r,x) for(int i=(l);i>=(r);i-=x)
#define pb push_back
#define pf push_front
#define ll long long
#define all(x) x.begin(),x.end()
#define sr(a) sort(a+1,a+n+1)
#define ins insert
#define F first
#define S second
#define pii pair<ll,int>
#define yes cout<<"YES"<<'\n';
#define no cout<<"NO"<<'\n';
#define sz(s) s.size()
#define int ll
#define level_up ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);

#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma comment (linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

using namespace std;

void file(string s) {
    freopen((s+".in").c_str(),"r",stdin);
    freopen((s+".out").c_str(),"w",stdout);
}

const double PI = 3.1415926535897932384626433832795;
const int MOD = 1e9 + 7;
const int N = 1e6 + 7;
int inf = INT_MAX;
char c[20][20];
bool w[20][20];
int cnt[N];
int sz=0;

void dfs(int i,int j){

    w[i][j]=true;
    sz++;

    if(w[i+1][j]==false and c[i+1][j]=='#'){
        dfs(i+1,j);
    }

    if(w[i-1][j]==false and c[i-1][j]=='#'){
        dfs(i-1,j);
    }

    if(w[i][j-1]==false and c[i][j-1]=='#'){
        dfs(i,j-1);
    }
    if(w[i][j+1]==false and c[i][j+1]=='#'){
        dfs(i,j+1);
    }

}

void run_case() {

    int n=10;
    int m=10;

    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            cin >> c[i][j];
        }
    }

    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            if(c[i][j]=='#' and (c[i+1][j+1]=='#' or c[i+1][j-1]=='#' or c[i-1][j+1]=='#' or c[i-1][j-1]=='#')){
                no;
                return;
            }
        }
    }

    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            if(c[i][j]=='#' and !w[i][j]){
                sz=0;
                dfs(i,j);
                cnt[sz]++;
            }
        }
    }

    if(cnt[1]!=4 or cnt[2]!=3 or cnt[3]!=2 or cnt[4]!=1){
        no;
        return;
    }

    yes;
}

main () {

    level_up;

    //file("sparse");

    int T=1;

    //cin >> T;

    while(T--) {
        run_case();
    }
}
/*

...
.#.
...

....
.##.
....

...
.#.
.#.
...

.....
.###.
.....

...
.#.
.#.
.#.
...

......
.####.
......

...
.#.
.#.
.#.
.#.
...

*/