#include <bits/stdc++.h>
using namespace std;
using ll = long long;

const int MAXN = 10;
vector<int> ships = {0, 4, 3, 2, 1};
bool is_possible = true;
int minx = -1, maxx = -1;
int miny = -1, maxy = -1;
vector<string> field(MAXN);
vector<vector<bool>> used(MAXN, vector<bool>(MAXN, false));

void dfs(int x, int y) {
	used[x][y] = true;
	if (minx == -1) {
		minx = x, maxx = x;
	}
	else {
		minx = min(x, minx);
		maxx = max(x, maxx);
	}
	if (miny == -1) {
		miny = y, maxy = y;
	}
	else {
		miny = min(miny, y);
		maxy = max(maxy, y);
	}
	for (int dx = -1; dx <= 1; dx++) {
		for (int dy = -1; dy <= 1; dy++) {
			int nx = x + dx;
			int ny = y + dy;
			if (0 <= nx && nx < 10) {
				if (0 <= ny && ny < 10) {
					if (!used[nx][ny] && field[nx][ny] == '#') {
						dfs(nx, ny);
					}
				}
			}
		}
	}
}

int main() {
	for (int i = 0; i < MAXN; i++) {
		cin >> field[i];
	}
	for (int x = 0; x < MAXN; x++) {
		for (int y = 0; y < MAXN; y++) {
			if (used[x][y] || field[x][y] == '.') continue;
			minx = -1;
			maxx = -1;
			miny = -1;
			maxy = -1;
			dfs(x, y);
			if (minx == maxx || miny == maxy) {
				int length = maxx - minx + maxy - miny + 1;
				if (1 <= length && length <= 4) {
					if (ships[length] > 0) {
						ships[length] -= 1;
						continue;
					}
				}
			}
			is_possible = false;
			break;
		}
		if (!is_possible) {
			break;
		}
	}
	if (is_possible) {
		cout << "YES\n";
	}
	else {
		cout << "NO\n";
	}
}