#include <bits/stdc++.h>
#define ll long long
// #define int ll
#define pii pair<int, int>
#define ff first
#define ss second
#define pb push_back
#define in insert
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)x.size()
#define deb(x) cout << #x << " = " << x << '\n';
#define file(x) freopen(x".in", "r", stdin), freopen(x".out", "w", stdout)
using namespace std;

// const int dx[] = {0, 1, 0, -1};
// const int dy[] = {1, 0, -1, 0};

const int inf = 1e9;
const ll INF = 1e18;
const int mod = 1e9 + 7;
const int N = 2e5 + 5;
int cnt[105];
string s[15];
bool used[15][15];

void solve() {
	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 (used[i][j]) continue;
			if (s[i][j]=='#'){
				used[i][j] = 1;
				int x = i + 1;
				bool ok1 = 0,ok2 = 0;
				while (x < 10 && s[x][j]=='#'){
					used[x][j] = 1;
					ok1 = 1;
					x++;
				}
				int y = j + 1;
				while(y < 10 && s[i][y]=='#'){
					used[i][y] = 1;
					ok2 = 1;
					y++;
				}
				if (ok1 && ok2){
					cout << 1 << '\n';
					cout << "NO";
					return;
				}
				int dis = 1;
                if (ok1) dis = x - i;
                if (ok2) dis = y - j;
                cnt[dis]++;
                if (dis > 4 || cnt[dis] > abs(dis-4)+1) {
                	cout << "NO";
                	return;
                }
			}
		}
	}
	for (int i=0;i<10;i++){
		for (int j=0;j<10;j++){
			if (i+1<10 && j+1<10 && s[i][j]=='#' && s[i+1][j+1]=='#'){
				cout << "NO";
				return;
			}
			if (i-1>=0 && j+1<10 && s[i][j]=='#'  && s[i-1][j+1]=='#'){
				cout << "NO";
				return;
			}
			if (i+1<10 && j-1>=0 && s[i][j]=='#' && s[i+1][j-1]=='#'){
				cout << "NO";
				return;
			}
			if (i-1>=0 && j-1>=0 && s[i][j]=='#' && s[i-1][j-1]=='#'){
				cout << "NO";
				return;
			}
		}

	}
	cout << "YES";
}

signed main() {
	ios_base::sync_with_stdio(0), cin.tie(0);
	int TT = 1;
	// cin >> TT;
	while(TT--) {
		solve();
	}
	return 0;
}