#pragma GCC optimize("unroll-loops")
#pragma gcc optimize("Ofast")
#pragma GCC optimization("Ofast")
#pragma optimize(Ofast)
#include <bits/stdc++.h>
using namespace std;

#define int long long
#define str string
#define fastio ios::sync_with_stdio(0), cin.tie(0);
#define fs first
#define ss second
#define endl '\n'
#define all(x) (x).begin(), (x).end()
#define len(x) x.size()

#define print(a)          \
    for (auto &x : a)     \
        cout << x << " "; \
    cout << endl;

#define printmp(a)    \
    for (auto &x : a) \
        cout << x.fs << " " << x.ss << endl;

const int mod = 1e9 + 7;

vector<vector<char>> a;
vector<vector<bool>> used;
multiset<int> ml = {4, 3, 3, 2, 2, 2, 1, 1, 1, 1};

int dfs_hor(int i, int j){
    used[i][j] = 1;
    if(j < 9 and a[i][j + 1] == '#' and !used[i][j + 1])
        return dfs_hor(i, j + 1) + 1;
    return 1;
}

int dfs_ver(int i, int j){
    used[i][j] = 1;
    if(i < 9 and a[i + 1][j] == '#' and !used[i + 1][j])
        return dfs_ver(i + 1, j) + 1;
    return 1;
}

void solve()
{
    a.resize(10, vector<char> (10));
    for(int i = 0; i < 10; i ++){
        for(int j = 0; j < 10; j ++){
            cin >> a[i][j];
        }
    }
    used.resize(10, vector<bool> (10));
    for(int i = 0; i < 10; i ++){
        for(int j = 0; j < 10; j ++){
            if(a[i][j] == '#' and (i < 9 and j < 9 and a[i + 1][j + 1] == '#')){
                cout << "NO";
                return;
            }
            if(a[i][j] == '#' and (i < 9 and j > 0 and a[i + 1][j - 1] == '#')){
                cout << "NO";
                return;
            }
            if(a[i][j] == '#' and !used[i][j]){
                int x = dfs_hor(i, j), y = dfs_ver(i, j);
                if(x != 1 and y != 1){
                    cout << "NO";
                    return;
                }
                if(ml.find(max(x, y)) != ml.end())
                    ml.erase(ml.find(max(x, y)));
                else{
                    cout << "NO";
                    return;
                }
            }
        }
    }
    if(ml.size() == 0)
        cout << "YES";
    else
        cout << "NO";
}

signed main()
{
    fastio int t = 1;
    // cin >> t;
    while (t--)
    {
        solve();
        cout << endl;
    }
}