#include <bits/stdc++.h>

#define fi first
#define se second

#define pw(x) (1LL << x)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define sz(x) (int)(x).size()

using namespace std;

template < typename T >
bool umn (T& a, T  b) {return a > b ? a = b, 1 : 0;}
template < typename T >
bool umx (T& a, T  b) {return a < b ? a = b, 1 : 0;}

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

const int N = 1e6 + 5;

char c[15][15];
int mp[10];
int main() {
#ifdef localy
    freopen ("input.txt", "r", stdin);
    freopen ("output.txt", "w", stdout);
#endif // localy
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int n = 10;

    for (int i = 0; i <= n + 3; ++ i) {
        for (int j = 0; j <= n + 3; ++ j) c[i][j] = '.';
    }

    for (int i = 1; i <= n; ++ i) {
        for (int j = 1; j <= n; ++ j) {
            cin >> c[i][j];
        }
    }

    for (int i = 1; i <= n; ++ i) {
        for (int j = 1; j <= n; ++ j) {
            if (c[i][j] == '#') {
                int stn = 0;
                ++ stn;
                if (c[i][j + 1] == '#') {
                    int id = j + 1;
                    while (id <= n && c[i][id] == '#') {
                        if (c[i + 1][id] != '.' || c[i - 1][id] != '.') {
                            cout << "NO\n";
                            return 0;
                        }

                        if (c[i + 1][id + 1] != '.' || c[i - 1][id + 1] != '.') {
                            cout << "NO\n";
                            return 0;
                        }

                        if (c[i + 1][id - 1] != '.' || c[i - 1][id - 1] != '.') {
                            cout << "NO\n";
                            return 0;
                        }
                        c[i][id] = '*';
                        ++ stn;
                        ++ id;
                    }
                }

                if (c[i + 1][j] == '#') {
                    int id = i + 1;
                    while (id <= n && c[id][j] == '#') {
                        if (c[id][j + 1] != '.' || c[id][j - 1] != '.') {
                            cout << "NO\n";
                            return 0;
                        }

                        if (c[id + 1][j + 1] != '.' || c[id + 1][j - 1] != '.') {
                            cout << "NO\n";
                            return 0;
                        }
                        if (c[id - 1][j + 1] != '.' || c[id - 1][j - 1] != '.') {
                            cout << "NO\n";
                            return 0;
                        }
                        c[id][j] = '*';
                        ++ stn;
                        ++ id;
                    }
                }
                    ++ mp[stn];
            }
        }
    }

//    cout << mp[1] << "\n";
//    cout << mp[2] << "\n";
//    cout << mp[3] << "\n";
//    cout << mp[4] << "\n";

    cout << (mp[1] == 4 && mp[2] == 3 && mp[3] == 2 && mp[4] == 1 ? "YES\n" : "NO\n");

    return 0;
}
