#include <iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<fstream>
#include<string>
#include<random>
#include<cmath>
#include<ctime>
#include<set>
#include<map>
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()
typedef long long ll;
using namespace std;
void solve();
int main()
{
	cin.tie(0)->sync_with_stdio(0);
	solve();
	return 0;
}

void solve()
{
	vector<vector<ll> > A(12, vector<ll>(12));
	char e;
	vector<ll>kols(5);
	for (ll i = 1; i < 11; ++i)
	{
		for (ll j = 1; j < 11; ++j)
		{
			cin >> e;
			if (e == '#')A[i][j] = 1;
			else A[i][j] = 0;
		}
	}
	for (ll i = 1; i < 11; ++i)
	{
		for (ll j = 1; j < 11; ++j)
		{
			if (A[i][j]==1&&(A[i - 1][j - 1] == 1 || A[i - 1][j + 1] == 1 || A[i + 1][j - 1] == 1 || A[i + 1][j + 1] == 1))
			{
				cout << "NO\n";
				exit(0);
			}
			if (A[i][j] == 1 && (A[i - 1][j] == 1 || A[i + 1][j] == 1) && (A[i][j - 1] == 1 || A[i][j + 1] == 1))
			{
				cout << "NO\n";
				exit(0);
			}
			if (A[i][j] == 1 && A[i][j + 1] != 1 && A[i + 1][j] != 1)
			{
				if (A[i][j - 1] == 1)
				{
					ll buf = 0;
					ll curi = i, curj = j;
					while (A[curi][curj] == 1)
					{
						++buf;
						--curj;
					}
					if (buf > 4)
					{
						cout << "NO\n";
						exit(0);
					}
					kols[buf]++;
				}
				else
				{
					ll buf = 0;
					ll curi = i, curj = j;
					while (A[curi][curj] == 1)
					{
						++buf;
						--curi;
					}
					if (buf > 4)
					{
						cout << "NO\n";
						exit(0);
					}
					kols[buf]++;
				}
			}

		}
	}
	for (ll i = 1; i < 5; ++i)
	{
		if (kols[i] != 5 - i)
		{
			cout << "NO\n";
			exit(0);
		}
	}
	cout << "YES\n";
	exit(0);
}