#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
#pragma GCC optimize("fast-math")

#define int long long
#define damkk ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0) ;
#define pb push_back
#define F first
#define S second
#define sz size()
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout);
#define all(s) (s).begin(),(s).end()

using namespace std ;

const int N = 1e5 + 1 ;
const int inf = 1e9 + 99 ;
const int MOD = 1e9 + 7 ;
const long double eps = 1e-11 ;
signed main(){
    damkk
    char c[15][15];
	int tt = 0;
    for(int i = 1 ; i <= 10; i++){
		for(int j = 1 ;j <= 10; j++){
			cin >> c[i][j];
			if(c[i][j] == '#'){
				tt++;
			}
		}
	}
	if(tt != 20){
		cout <<"NO\n";
		return 0;
	}
	for(int i =0; i <= 11; i++){
		for(int j =0 ; j <= 11; j++){
			if(i == 0 || j == 0 || i == 11 || j == 11){
				c[i][j] = '.';
			}
		}
	}
	for(int  i = 1; i <= 10; i++){
		for(int j = 1; j <= 10; j++){
			if(c[i][j] == '#'){
				if(c[i + 1][j + 1] == '#' || c[i - 1][j + 1] == '#' || c[i - 1][j - 1] == '#' || c[i + 1][j - 1] == '#'){
					cout << "NO\n";
					return 0;
				}
				if(c[i + 1][j] == '#' || c[i - 1][j] == '#'){
					if(c[i][j + 1] == '#' || c[i][j - 1] == '#'){
						cout <<"NO\n";
						return 0;
					}
				}
			}
		}
	}
	cout <<"YES\n";
}
