#include <bits/stdc++.h>

#define _FORTIFY_SOURCE 0
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("fast-math")

using namespace std;

typedef long long ll;
typedef long double ld;
#define int ll
#define double ld

#ifdef LOCAL
#   define dbg(x) cout << #x " = " << (x) << '\n';
#   define dbgf printf
#else
#   define dbg(x)
#   define dbgf(...)
#endif

#define all(x) std::begin(x), std::end(x)
#define rall(x) std::rbegin(x), std::rend(x)

template<typename T1, typename T2>
ostream &operator<<(ostream &out, pair<T1, T2> &p) {
    return out << p.first << ' ' << p.second;
}

template<typename T1, typename T2>
istream &operator>>(istream &in, pair<T1, T2> &p) {
    return in >> p.first >> p.second;
}

const auto boostIO = []() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cout << fixed;
    cout.precision(12);
    return 0;
} ();

void solve() {
    vector<string> a(10);
    for (int i = 0; i < 10; i++) {
        cin >> a[i];
    }
    bool can = true;
    map<int, int> cnt;
    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            int cnt_cur = 0;
            if (a[i][j] == '#' && (!i || a[i - 1][j] != '#') && (i + 1 >= 10 || a[i + 1][j] != '#')) {
                while (j < 10 && a[i][j] == '#') {
                    j++;
                    cnt_cur++;
                }
            }
            if (cnt_cur) {
                cnt[cnt_cur]++;
            }
        }
    }
    for (int j = 0; j < 10; j++) {
        for (int i = 0; i < 10; i++) {
            int cur_cnt = 0;
            if (a[i][j] == '#' && (!j || a[i][j - 1] != '#') && (j + 1 >= 10 || a[i][j + 1] != '#')) {
                while (i < 10 && a[i][j] == '#') {
                    cur_cnt++;
                    i++;
                }
            }
            if (cur_cnt) {
                cnt[cur_cnt]++;
            }
        }
    }
    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            if (a[i][j] == '#') {
                if (i && j) {
                    can &= (a[i - 1][j] != '#' || a[i][j - 1] != '#');
                    can &= (a[i - 1][j - 1] != '#');
                }
                if (i && j + 1 < 10) {
                    can &= (a[i - 1][j] != '#' || a[i][j + 1] != '#');
                    can &= (a[i - 1][j + 1] != '#');
                }
                if (i + 1 < 10 && j + 1 < 10) {
                    can &= (a[i + 1][j] != '#' || a[i][j + 1] != '#');
                    can &= (a[i + 1][j + 1] != '#');
                }
                if (i + 1 < 10 && j) {
                    can &= (a[i + 1][j] != '#' || a[i][j - 1] != '#');
                    can &= (a[i + 1][j - 1] != '#');
                }
            }
        }
    }
    can &= (cnt[1] == 8);
    can &= (cnt[2] == 3);
    can &= (cnt[3] == 2);
    can &= (cnt[4] == 1);
    cout << (can ? "YES" : "NO") << '\n';
}

signed main() {

    solve();

    return 0;
}