#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <random>
#include <numeric>
#include <map>
#include <set>
#include <string>

using namespace std;
using ll = long long;
using ld = long double;

#define deb(x) cerr << #x << ":\t" << x << '\n';
#define len(x) (ll) x.size()

const ll INF = 1e18;
const ll MOD = 1e9 + 7;
char a[10][10];
bool used[10][10];
int cnt = 0;
void dfs(int i, int j) {
    cnt++;
    used[i][j] = 1;
    if (i + 1 < 10 && !used[i + 1][j] && a[i + 1][j] == '#') dfs(i + 1, j);
    if (i - 1 >= 0 && !used[i - 1][j] && a[i - 1][j] == '#') dfs(i - 1, j);
    if (j + 1 < 10 && !used[i][j + 1] && a[i][j + 1] == '#') dfs(i, j + 1);
    if (j - 1 >= 0 && !used[i][j - 1] && a[i][j - 1] == '#') dfs(i, j - 1);
}
void solve() {
    for (int i = 0; i < 10; i++) for (int j = 0; j < 10; j++) cin >> a[i][j];
    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            if (a[i][j] == '.') continue;
            if (i + 1 < 10 && j + 1 < 10 && a[i + 1][j + 1] == '#') { cout << "NO"; return; }
            if (i + 1 < 10 && j - 1 >= 0 && a[i + 1][j - 1] == '#') { cout << "NO"; return; }
            if (i - 1 >= 0 && j + 1 < 10 && a[i - 1][j + 1] == '#') { cout << "NO"; return; }
            if (i - 1 >= 0 && j - 1 >= 0 && a[i - 1][j - 1] == '#') { cout << "NO"; return; }
        }
    }
    vector <int> kol(5);
    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            if (a[i][j] == '#' && !used[i][j]) {
                cnt = 0;
                dfs(i, j);
                if (cnt > 4) { cout << "NO"; return; }
                kol[cnt]++;
            }
        }
    }
    if (kol[1] == 4 && kol[2] == 3 && kol[3] == 2 && kol[4] == 1) cout << "YES";
    else cout << "NO";
}

int main() {
    int T = 1;
    //    cin >> T;
    while (T--) {
        solve();
    }
    return 0;
}
