#include "bits/stdc++.h"

using namespace std;

using ll = long long;
using ld = long double;

//@formatter:off
template<typename T> istream &operator>>(istream &is, vector<T> &vec);
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec);
//@formatter:on

struct hash_pair {
	template<class T1, class T2>
	size_t operator()(const pair<T1, T2> &p) const {
		auto hash1 = hash<T1>{}(p.first);
		auto hash2 = hash<T2>{}(p.second);

		if (hash1 != hash2) {
			return hash1 ^ hash2;
		}

		return hash1;
	}
};

signed main() {
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#else
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
#endif
	int n = 10;
	vector<vector<char>> a(n + 2, vector<char>(n + 2, '.'));
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= n; ++j)
			cin >> a[i][j];

	vector<int> cnt(5);

	vector<vector<bool> > used(n + 2, vector<bool>(n + 2));
	for (int starti = 1; starti <= n; ++starti) {
		for (int startj = 1; startj <= n; ++startj) {
			if (a[starti][startj] == '.') continue;

			int i = starti, j = startj;
			if (!used[i][j]) {
				int t = 0;
				for (int x = -1; x <= 1; ++x) {
					for (int y = -1; y <= 1; ++y) {
						if (x == 0 and y == 0) continue;

						t += a[i + x][j + y] == '#';
					}
				}

				if (t > 1) {
					cout << "NO\n";
					return 0;
				}

				int now = 1;
				if (a[i + 1][j] == '#') {
					for (i = i + 1; a[i][j] == '#'; ++i) {
						used[i][j] = true;
						now++;
					}
				} else {
					for (j = j + 1; a[i][j] == '#'; ++j) {
						used[i][j] = true;
						now++;
					}
				}
				cnt[now]++;

				if (now == 1 and t >= 1 or now > 4) {
					cout << "NO\n";
					return 0;
				}
			}
		}
	}
	//    cout << cnt;
	if (cnt[1] == 4 and cnt[2] == 3 and cnt[3] == 2 and cnt[4] == 1) cout << "YES\n";
	else cout << "NO\n";
}

template<typename T>
istream &operator>>(istream &is, vector<T> &vec) {
	for_each(vec.begin(), vec.end(), [&](auto &i) { is >> i; });
	return is;
}

template<typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
	for_each(vec.begin(), vec.end(), [&](auto &i) { os << i << ' '; });
	return (os << '\n');
}