#include <bits/stdc++.h>

using namespace std;
using ull = unsigned long long;
using ld = long double;
using ll = long long;
using PII = pair<int, int>;
using PLL = pair<long long, long long>;
using PSS = pair<string, string>;
using ui = unsigned int;

#define fast_io ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define lb(set, x) set.lower_bound(x)
#define ub(set, x) set.upper_bound(x)

const ll INF = 1e18;
const ll MOD = 1e9 - 7;

void no() {
    cout << "NO\n";
    exit(0);
}

void solve() {

    vector<vector<int>> table(10, vector<int>(10)), used(10, vector<int>(10));
    for (int i = 0; i < 10; ++i) {
        string s;
        cin >> s;
        for (int j = 0; j < 10; ++j)
            if (s[j] == '#')
                table[i][j] = !table[i][j];
    }

    vector<int> ships(4);
    for (int i = 0; i < 10; ++i) {
        for (int j = 0; j < 10; ++j) {
            if (!used[i][j] && table[i][j]) {

                int idx = j + 1, cnt = 1;
                while (idx < 10) {
                    if (table[i][idx]) {
                        if (used[i][idx])
                            no();
                        else
                            used[i][idx] = true;
                        if (i != 9 && table[i + 1][idx] || (i != 9 && idx != 9 && table[i + 1][idx + 1]))
                            no();
                        ++cnt;
                    } else {
                        break;
                    }
                    ++idx;
                }

                if (i < 9 && table[i + 1][j] && cnt != 1)
                    no();

                idx = i + 1;
                while (idx < 10) {
                    if (table[idx][j]) {
                        if (used[idx][j])
                            no();
                        else
                            used[idx][j] = true;
                        if (j != 9 && table[idx][j + 1] || (j != 9 && idx != 9 && table[idx + 1][j + 1]))
                            no();
                        ++cnt;
                    } else {
                        break;
                    }
                    ++idx;
                }

                ++ships[cnt - 1];
            }
        }
    }

    for (int i = 0; i < 4; ++i) {
        if (ships[i] != 4 - i)
            no();
    }

    cout << "YES\n";
}

signed main() {
    fast_io;
    solve();
    return 0;
}