#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<set>
#include<map>
#include<iomanip>
#include<bitset>
#include<unordered_set>
#include<unordered_map>
#include<queue>
#include<stack>
#include<deque>
using namespace std;
#define int long long
#define all(x) x.begin(), x.end()

void solve() {
	string s;
	char c;
	int n = 10;
	vector<vector<int>> field(n+5, vector<int> (n+5, 0));
	vector<vector<int>> neighbours(n+5, vector<int>(n + 5, 0));
	for (int i = 1; i <= n; ++i) {
		cin >> s;
		for (int j = 1; j <= n; ++j) {
			if (s[j - 1] == '#') field[i][j] = 1;
		}
	}
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= n; ++j) {
			neighbours[i][j] = field[i - 1][j] + field[i][j - 1] + field[i + 1][j] + field[i][j + 1] + field[i + 1][j + 1] + field[i - 1][j + 1] + field[i - 1][j - 1] + field[i + 1][j - 1];
		}
	}
	int cnt1=0, cnt2=0, cnt3=0, cnt4=0;
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= n; ++j) {
			// check 1
			if (field[i][j] && neighbours[i][j] == 0) cnt1++;
			// check 2
			else if ((field[i][j] && field[i][j + 1]) && neighbours[i][j] == 1 && neighbours[i][j + 1] == 1 ||
				(field[i][j] && field[i + 1][j]) && neighbours[i][j] == 1 && neighbours[i + 1][j] == 1) cnt2++;
			// check 3
			else if ((field[i][j] && field[i + 1][j] && field[i + 2][j]) && neighbours[i][j] == 1 && neighbours[i + 1][j] == 2 && neighbours[i + 2][j] == 1 ||
				(field[i][j] && field[i][j + 1] && field[i][j + 2]) && neighbours[i][j] == 1 && neighbours[i][j + 1] == 2 && neighbours[i][j + 2] == 1) cnt3++;
			// check 4
			else if ((field[i][j] && field[i + 1][j] && field[i + 2][j] && field[i + 3][j]) && neighbours[i][j] == 1 && neighbours[i + 1][j] == 2 && neighbours[i + 2][j] == 2 && neighbours[i + 3][j] == 1 ||
				(field[i][j] && field[i][j + 1] && field[i][j + 2] && field[i][j + 3]) && neighbours[i][j] == 1 && neighbours[i][j + 1] == 2 && neighbours[i][j + 2] == 2 && neighbours[i][j + 3] == 1) cnt4++;
		}
	}
	if (cnt4 == 1 && cnt3 == 2 && cnt2 == 3 && cnt1 == 4) cout << "YES\n";
	else cout << "NO\n";
}

int getans(int h, int w) {
	if (h == 0) return 0;
	else if (h == 1 && w == 1) return 1;
	if (h < w) swap(h, w);
	return h*w + getans(h / 2, w) + getans((h + 1) / 2, w);
}

void solve1() {
	int h, w;
	cin >> h >> w;
	cout << getans(h, w) << '\n';
}

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int t = 1;
	// cin >> t;
	while (t--) {
		solve();
	}
}