#include <iostream>
#include <vector>
#include<string>
#include<set>
#include <stack>
#include <iomanip>
#include <cmath>
#include<map>
#include <deque>
#include <queue>
using namespace std;
using ll = long long;
using ld = long double;

ll gcd(ll a, ll b) {
	while (b > 0) {
		if (a < 0) {
			a = (a % b + b) % b;
		}
		else {
			a %= b;
		}
		swap(a, b);
	}
	return 0;
}
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}
signed main(){
	vector<string>s(10);
	string a, b, c, d;
	a = "####";
	b = "###";
	c = "##";
	d = '#';
	ll a1 = 0, b1 = 0, c1 = 0, d1 = 0;
	for (ll i = 0; i < 10; ++i) {
		string f;
		cin >> f;
		s[i] = f;
		if (f.find(a)< f.size()) {
			a1 += 1;
		}
		else if (f.find(b) < f.size()) {
			b1 += 1;
		}
		else if (f.find(c) < f.size()) {
			c1 += 1;
		}
		else if (f.find(d) <f.size()) {
			d1 += 1;
		}
		
	}
	for (ll i = 0; i < 10; ++i) {
		string f = "";
		for (ll j = 0; j < 10; ++j) {
			f += s[j][i];
		}
		if (f.find(a) < f.size()) {
			a1 += 1;
		}
		else if (f.find(b) < f.size()) {
			b1 += 1;
		}
		else if (f.find(c) < f.size()) {
			c1 += 1;
		}
	}
	if (a1 != 1 || b1 != 2 || c1 != 3 || d1 < 4) {
		cout << "NO";
		return 0;
	}
	for (ll i = 0; i < 10; ++i) {
		for (ll j = 0; j < 10; ++j) {
			if (i != 9 && j != 9 && s[i][j] == '#' &&(( s[i + 1][j] == '#' && s[i][j + 1] == '#') || s[i+1][j+1]=='#' )) {
				cout << "NO";
				return 0;
			}
		}
	}
	cout << "YES";
}
