#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 cnt = 0;
    for(int i = 1; i <= 10; i ++){
    	for(int j = 1; j <= 10 ;j ++){
    		cin >> c[i][j];
    		if(c[i][j] == '#'){
    			cnt++;
			}
		}
	}
	if(cnt != 20){
		cout << "NO\n";
		return 0;
	}
	int ship[7];
	ship[1] = 0;
	ship[2] = 0;
	ship[3] = 0;
	ship[4] = 0;
	ship[5] = 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] == '#' || c[i - 1][j] == '#'){
					continue;
				}
				if(c[i][j + 1] != '#' && c[i][j - 1] != '#' && c[i + 1][j] != '#' && c[i - 1][j] != '#'){
					ship[1]++;
				}
				else{
					int y = 1;
					for(int l = j + 1; l <= 10;l++){
						if(c[i][l] == '#'){
							y++;
							if(y >= 5){
								cout << "NO\n";
								return 0;
							}
						}
						else{
							j = l;
							if(y == 1){
								break;
							}
							ship[y]++;
							break;
						}
					}
				}
			}
		}
	}
	for(int j = 1; j <= 10 ; j++){
		for(int i = 1; i <= 10; i++){
			if(c[i][j] == '#'){
				if(c[i][j + 1] == '#' || c[i][j - 1] == '#'){
					continue;
				}
				int y = 1;
				for(int l = i + 1; l <= 10; l++){
					if(c[l][j] == '#'){
						y++;
						if(y >= 5){
							cout << "NO\n";
							return 0;
						}
					}
					else{
						i = l;
						if(y == 1){
							break;
						}
						ship[y]++;
						break;
					}
				}
			}
		}
	}
	if(ship[1] != 4 || ship[2] != 3 || ship[3] != 2 || ship[4] != 1){
		cout << "NO\n";
		return 0;
	}
	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";
}
