#ifdef LOCAL
    #define _GLIBCXX_DEBUG
#endif // LOCAL

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <unordered_map>
#include <map>
#include <set>
#include <unordered_set>
#include <bitset>
#include <queue>
#include <iomanip>
#include <iterator>
#include <fstream>
#include <cstdlib>
#include <random>
#include <climits>
#include <chrono>

using namespace std;

#define int long long
#define f first
#define s second
#define fi first
#define se second
#define p_b push_back
#define e_b emplace_back
#define pw(x) (1LL<<((int)x))
#define sz(x) (ll)x.size()
#define m_p make_pair
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()

using ll = long long;
using ul = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using ld = long double;

const ll N = 2e5 + 5, mod = 1e9+7;

template<class T> inline T sqr(T x) {return x * x;}
template<class T> inline void amin(T &a, T b) {a = a < b ? a : b;}
template<class T> inline void amax(T &a, T b) {a = a > b ? a : b;}
template<class T> inline void smod(T &a, T b) {a = a + b >= mod ? a + b - mod : a + b;}
template<class T> inline void dmod(T &a, T b) {a = a - b >= 0 ? a - b : a - b + mod;}

mt19937 rnd(time(0));

int cnt[5];
bool used[10][10];
char mtr[10][10];
queue<pii> q;

bool check(int i, int j) {
//    cout << '\t' << i << ' ' << j << '\n';
    if (i < 0 || i == 10 || j < 0 || j == 10 || mtr[i][j] == '.')
        return 0;
    if (!used[i][j])
        q.push({i, j});
    used[i][j] = 1;
    return 1;
}

void solve() {
    for (int i = 0; i < 10; i++)
        for (int j = 0; j < 10; j++)
            cin >> mtr[i][j];
    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            if (used[i][j] || mtr[i][j] == '.')
                continue;
            int cur = 0;
            check(i, j);
            while (sz(q)) {
                auto [x, y] = q.front();
                q.pop();
                cur++;
//                cout << x << ' ' << y << '\n';
                bool vert1 = check(x - 1, y), vert2 = check(x + 1, y),
                line1 = check(x, y + 1), line2 = check(x, y - 1);
                bool vert = vert1 || vert2, line = line1 || line2;
                if ((vert && line) || check(x + 1, y + 1) || check(x + 1, y - 1) || check(x - 1, y - 1) || check(x - 1, y + 1)) {
                    cout << "NO\n";
                    return;
                }
            }
//            cout << '\n';
            if (cur > 4) {
                cout << "NO\n";
                return;
            }
            cnt[cur]++;
        }
    }
//    cout << cnt[1] << ' ' << cnt[2] << ' ' << cnt[3] << ' ' << cnt[4] << '\n';
    if (cnt[1] == 4 && cnt[2] == 3 && cnt[3] == 2 && cnt[4] == 1)
        cout << "YES\n";
    else
        cout << "NO\n";
}

main() {
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #else
        ios_base::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
    #endif // LOCAL
    int t = 1;
//    cin >> t;
    while (t--) {
        solve();
    }
    #ifdef LOCAL
        cout << "\n\n===\nTime : " << (long double)clock() / CLOCKS_PER_SEC << '\n';
    #endif // LOCAL
}
