#pragma GCC optimize ("03,unroll-loops")
//#pragma GCC target ("avx,avx2,bmi,bmi2,lzcnt,popcnt")
#include <bits/stdc++.h>

using namespace std;
#define int long long
#define foru(i, x, n) for (int i = x; i < n; i++)
#define ford(i, x, n) for (int i = x; i >= n; i--)
#define forn(i, n) for (int i = 0; i < n; i++)
#define pb push_back
#define ft first
#define sd second
#define elif else if
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

template <typename T, typename Y>
istream& operator>> (istream& in, pair<T, Y>& a) {
    in >> a.first >> a.second;
    return in;
}

template <typename T>
istream& operator>> (istream& in, vector<T>& a) {
    forn(i, a.size())
        in >> a[i];
    return in;
}

template<typename T>
ostream& operator<< (ostream& out, vector<T>& a) {
    out << a[0];
    foru(i, 1, a.size())
        out << ' ' << a[i];
    out << '\n';
    return out;
}

const int MAX=1e9+1;
const double EPS = 1e-9;

int clr(vector<string>& a, int i, int j, int di, int dj) {
    int cnt = 0;
    while (i < 10 && j< 10 && a[i][j] == '#') {
        if (i + 1 < 10 && j+1 < 10 && a[i+1][j+1] == '#')
            return -1;
        if (i + 1 < 10 && j - 1 >= 0 && a[i+1][j-1] == '#')
            return -1;
        if (dj == 1 && i+1 < 10 && a[i+1][j] == '#')
            return -1;
        if (di == 1 && ((j + 1 < 10 && a[i][j+1] == '#') || (j - 1 >= 0 && a[i][j-1]== '#')))
            return -1;
        cnt++;
        a[i][j] = '.';
        i += di;
        j += dj;
    }
    return cnt;
}

void solve() {
    vector<string> a(10);
    cin >> a;
    vector<int> cnt(4);
    int c = 0;
    forn(i, 10)
        forn(j, 10) {
            if (a[i][j] == '#') {
                if (i + 1 < 10 && a[i+1][j] == '#')
                    c = clr(a, i, j, 1, 0);
                elif (j + 1 < 10 && a[i][j+1] == '#')
                    c = clr(a, i, j, 0, 1);
                else {
                    a[i][j] = '.';
                    c = 1;
                }
                if (c == -1 || c > 4) {
                    cout << "NO";
                    return;
                }
                cnt[c-1]++;
            }
        }
    cout << "NO\0YES" + 3*(cnt[0] == 4 && cnt[1] == 3 && cnt[2] == 2 && cnt[3] == 1);
}

signed main()
{
    fast;
    int t = 1;
    //cin >> t;
    while (t--)
        solve();
    return 0;
}

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