#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ld = long double;
using ull = unsigned long long;
using vi = vector<ll>;
using vvi = vector<vi>;
using pi = pair<ll, ll>;
using vpi = vector<pi>;
const ll inf = 998244353;


char gr[11][11];
bool used[11][11];
vector<pair<int, int>> a;

vector<int> dx = {1, -1, 0, 0, 1, 1, -1, -1};
vector<int> dy = {0, 0, -1, 1, -1, 1, -1, 1};

int n = 10;
inline bool good(int x, int y){
    return 0 <= x && x < n && 0 <= y && y < n;
}

void dfs(int x, int y, int step = -1){
    used[x][y] = 1;
    a.push_back({x, y});
    for(int i = 0; i < 8; ++i){
        int nx = x + dx[i], ny = y + dy[i];
        if(good(nx, ny) && gr[nx][ny] == '#' && !used[nx][ny]){
            dfs(nx, ny, i);
            if(i > 3){
                cout << "NO\n";
                exit(0);
            }
            if (step != -1 && step != i){
                cout << "NO\n";
                exit(0);
            }
        }
    }
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    for(int i = 0; i < n; ++i)for(int j = 0; j < n; ++j){
        used[i][j] = 0;
        cin >> gr[i][j];
    }

    //касание

    map<int, int> m;
    set<int> s;
    for(int i = 0; i < n; ++i)for(int j = 0; j < n; ++j){
        if(!used[i][j] && gr[i][j] == '#'){
            a.clear();
            dfs(i, j);
            m[a.size()]++;
            s.insert(a.size());
        }
    }

    if(m[1] == 4 && m[2] == 3 && m[3] == 2 && m[4] == 1 && s.size() == 4){
        cout << "YES\n";
    }else{
        cout << "NO\n";
    }

}
