#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <cstdio>
#include <random>
#include <chrono>

using namespace std;

using ll = long long;
using ld = long double;

mt19937_64 rnd(chrono::steady_clock::now().time_since_epoch().count());

#define int long long
#define all(x) (x).begin(), (x).end()
vector<string> a;

vector<pair<ll, ll>> d = {
        {1,  0},
        {0,  1}
};

vector<vector<bool>> used;

bool can = true;

ll dfs(ll x, ll y, ll fl = -1) {
    ll S = 1;
    used[x][y] = true;
    if (x < 9 && y < 9 && a[x + 1][y + 1] == '#') {
        can = false;
        return -1;
    }
    if (x > 0 && y < 9 && a[x - 1][y + 1] == '#') {
        can = false;
        return -1;
    }
    if (x < 9 && y > 0 && a[x + 1][y - 1] == '#') {
        can = false;
        return -1;
    }
    if (x > 0 && y > 0 && a[x - 1][y - 1] == '#') {
        can = false;
        return -1;
    }
    for (auto& [dx, dy] : d) {
        ll x1 = x + dx, y1 = y + dy;
        if (x1 < 0 || x1 > 9 || y1 < 0 || y1 > 9 || a[x1][y1] == '.') {
            continue;
        }
        if (used[x1][y1]) {
            can = false;
            return -1;
        }
        if (fl == -1) {
            if (dx) {
                fl = 0;
            }
            else {
                fl = 1;
            }
        }
        else {
            if (dx && fl || dy && !fl) {
                can = false;
                return -1;
            }
        }
        S += dfs(x1, y1, fl);
    }
    return S;
}

void solve() {
    a.resize(10);
    for (auto &it : a) {
        cin >> it;
    }
    used.resize(10, vector <bool>(10));
    map <ll, ll> cnt;
    for (ll i = 0; i < 10; i++) {
        for (ll j = 0; j < 10; j++) {
            if (!used[i][j] && a[i][j] == '#') {
                ll sz = dfs(i, j);
                if (!can) {
                    cout << "NO";
                    return;
                }
                cnt[sz]++;
            }
        }
    }
    if (cnt.find(4) != cnt.end()
    && cnt[4] == 1
    && cnt.find(3) != cnt.end()
    && cnt[3] == 2
    && cnt.find(2) != cnt.end()
    && cnt[2] == 3
    && cnt.find(1) != cnt.end()
    && cnt[1] == 4 && cnt.size() == 4) {
        cout << "YES";
    }
    else {
        cout << "NO";
    }
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll timer = 1;
    // cin >> timer;
    while (timer--) {
        solve();
    }
    return 0;
}

/*
#.#.#.....
.......##.
.#..#.....
.#........
.#..##....
..........
####...#..
.......#..
.......#..
##........

 */