#include<bits/stdc++.h>

#define y1 govno
#define y2 urior
#define x1 ijirj
#define x2 orijw

using namespace std;
using ll = long long;

char a[11][11];
int n = 10, x1, x2, y1, y2;
bool used[11][11];

pair<int, int> dir[] = {{0, 1}, {1, 0}, {0, -1}, {-1, 0}};
pair<int, int> rid[] = {{-1, 1}, {1, -1}, {-1, -1}, {1, 1}};

void dfs(int i, int j) {
    used[i][j] = 1;
    x1 = min(x1, i);
    x2 = max(x2, i);
    y1 = min(y1, j);
    y2 = max(y2, j);
    for(auto e : dir) {
        int x = i+e.first;
        int y = j+e.second;
        if(used[x][y] || x < 1 || x > n || y < 1 || y > n || a[x][y] == '.') {
            continue;
        }
        dfs(x, y);
    }
}

int main() {
    ios_base::sync_with_stdio(NULL);
    cin.tie(0);
    for(int i = 1; i <= n; ++i) {
        for(int j = 1; j <= n; ++j) {
            cin >> a[i][j];
        }
    }
    map<int, int> cnt;
    for(int i = 1; i <= n; ++i) {
        for(int j = 1; j <= n; ++j) {
            if(a[i][j] == '#' && !used[i][j]) {
                x1 = n+1;
                x2 = 0;
                y1 = n+1;
                y2 = 0;
                dfs(i, j);
                if(x1 == x2 && y2 - y1 < 4) {
                    cnt[y2-y1+1]++;
                    continue;
                }
                if(y1 == y2 && x2 - x1 < 4) {
                    cnt[x2-x1+1]++;
                    continue;
                }
                cout << "NO\n";
                exit(0);
            }
        }
    }
    for(int i = 1; i <= n; ++i) {
        for(int j = 1; j <= n; ++j) {
            if(a[i][j] != '#') {
                continue;
            }
            for(auto e : rid) {
                int x = i+e.first;
                int y = j+e.second;
                if(x < 1 || x > n || y < 1 || y > n || a[x][y] == '.') {
                    continue;
                }
                cout << "NO\n";
                return 0;
            }
        }
    }
    if(cnt[4] == 1 && cnt[3] == 2 && cnt[2] == 3 && cnt[1] == 4) {
        cout << "YES\n";
    } else {
        cout << "NO\n";
    }
    return 0;
}
