#include <bits/stdc++.h>

using namespace std;

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

#define int long long

const int X[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const int Y[8] = {0, -1, -1, -1, 0, 1, 1, 1};

bool vert(int i, int j, vector< vector<char> >& arr, vector< vector<bool> >& used, int* ans) {
    int x, y;
    bool f = true;
    int cnt = 0;
    for (; i < 10 and arr[i][j] == '#' and f; i++) {
        used[i][j] = 1;
        cnt++;
        for (int k = 0; k < 8 and f; k++) {
            x = i + X[k];
            y = j + Y[k];
            if (x < 10 and y < 10 and x >= 0 and y >= 0) {
                if (arr[x][y] == '#' and used[x][y] == 0 and (x != i + 1 or y != j)) {
                    f = false;
                }
            }
        }
    }
    if (cnt >= 5) {
        f = false;
    } else {
        ans[cnt]++;
    }
    return f;
}

bool horiz(int i, int j, vector< vector<char> >& arr, vector< vector<bool> >& used, int* ans) {
    int x, y;
    bool f = true;
    int cnt = 0;
    for (; j < 10 and arr[i][j] == '#' and f; j++) {
        used[i][j] = 1;
        cnt++;
        for (int k = 0; k < 8 and f; k++) {
            x = i + X[k];
            y = j + Y[k];
            if (x < 10 and y < 10 and x >= 0 and y >= 0) {
                if (arr[x][y] == '#' and used[x][y] == 0 and (x != i or y != j + 1)) {
                    f = false;
                }
            }
        }
    }
    if (cnt >= 5) {
        f = false;
    } else {
        ans[cnt]++;
    }
    return f;
}

void solve() {
    vector< vector<char> > arr(10, vector<char>(10));
    vector< vector<bool> > used(10, vector<bool>(10, 0));
    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            cin >> arr[i][j];
        }
    }

    int ans[5] = {0, 0, 0, 0, 0};
    bool f = true;
    for (int i = 0; i < 10 and f; i++) {
        for (int j = 0; j < 10 and f; j++) {
            if (arr[i][j] == '#' and !used[i][j]) {
                if (j == 9 or arr[i][j + 1] == '.') { // no '#' to the right
                    if (!vert(i, j, arr, used, ans)) {
                        f = false;
                    }
                } else { // there are '#' to the right
                    if (i != 9 and arr[i + 1][j] == '#') { // there are '#' to the down
                        f = false;
                        continue;
                    }
                    if (!horiz(i, j, arr, used, ans)) {
                        f = false;
                    }
                }
            }
        }
    }

    if (ans[1] != 4 or ans[2] != 3 or ans[3] != 2 or ans[4] != 1) {
        f = false;
    }

    if (f) {
        cout << "YES";
    } else {
        cout << "NO";
    }
}


signed main()
{
    int t = 1;
    //cin >> t;
    //freopen("input.in", "r", stdin);
    while (t--) {
        solve();
    }
    return 0;
}

