# include <bits/stdc++.h>

# define pb push_back
# define ff first
# define ss second
# define nl "\n"
# define sz(x) ((int)(x).size())
# define all(x) (x).begin(), (x).end()
# define deb(x) cerr << #x  << " = " << x << endl; 
# define pll pair <ll, ll>
# define pii pair <int, int>
 
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
 
const ll maxn = 2e5 + 7;
const ll inf = 2e18 + 0;
const ll mod = 1e9 + 7;
const ll dx[] = {-1, 1, 0, 0, -1, 1, -1, 1};
const ll dy[] = {0, 0, -1, 1, -1, 1, 1, -1};

using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int n = 10;
int cnt[111];

bool in (int x, int y){
	return (1 <= x && x <= n && 1 <= y && y <= n);
}

void ma1n () {
	char c[n + 3][n + 3];
	bool used[n + 3][n + 3] = {};
	bool cur[n + 3][n + 3] = {};
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= n; ++j) {
			cin >> c[i][j];
		}
	}
	for (int i = 1; i <= n; ++i) {
		for (int j = 1; j <= n; ++j) {
			if (c[i][j] == '#' && !used[i][j]) {
				int x = i, y = j;
				while (y + 1 <= n && !used[i][y + 1] && c[i][y + 1] == '#') ++y;
				while (x + 1 <= n && !used[x + 1][j] && c[x + 1][j] == '#') ++x;
//				cout << i << ' ' << j << ' ' << x << ' ' << y << nl;
				if (x == i && y != j) {
					for (int k = j; k <= y; ++k) {
						used[i][k] = 1;
						cur[i][k] = 1;
					}
					for (int o = j; o <= y; ++o) {
						for (int k = 0; k < 8; ++k) {
							int tox = i + dx[k];
							int toy = o + dy[k];
							if (cur[tox][toy]) continue;
							if (in(tox, toy) && c[tox][toy] == '#') {
								cout << "NO" << nl;
								exit(0);
							}
						}
					}
					for (int k = j; k <= y; ++k) {
						cur[i][k] = 0;
					}
					cnt[y - j + 1]++;
				}
				else if (x != i && y == j) {
					for (int k = i; k <= x; ++k) {
						used[k][j] = 1;
						cur[k][j] = 1; 
					}
					for (int o = i; o <= x; ++o) {
						for (int k = 0; k < 8; ++k) {
							int tox = o + dx[k];
							int toy = j + dy[k];
							if (cur[tox][toy]) continue;
							if (in(tox, toy) && c[tox][toy] == '#') {
								cout << "NO" << nl;
								exit(0);
							}
						}
					}
					for (int k = i; k <= x; ++k) {
						cur[k][j] = 0; 
					}
					cnt[x - i + 1]++;
				}
				else if (x == i && y == j) {
					used[i][j] = 1;
					for (int k = 0; k < 8; ++k) {
						int tox = i + dx[k];
						int toy = j + dy[k];
						if (in(tox, toy) && c[tox][toy] == '#') {
							cout << "NO" << nl;
							exit(0);
						}
					}
					cnt[1]++;
				}
				else {
					cout << "NO" << nl;
					exit(0);
				}
			}
		}
	}
//	for (int i = 1; i <= 4; ++i) {
//		cout << cnt[i] << ' ';
//	}
//	cout << nl << nl;
	if (cnt[4] == 1 && cnt[3] == 2 && cnt[2] == 3 && cnt[1] == 4) {
		cout << "YES\n";
	}
	else {
		cout << "NO\n";
	}
}
 
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
//  freopen("file.in", "r", stdin);
//  freopen("file.out", "w", stdout);
    int ttt = 1;
//  cin >> ttt;
    for (int test = 1; test <= ttt; ++test) {
//      cout << "Case " << test << ":" << '\n';
        ma1n();
    }
    return 0;
}
