#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <bitset>
#include <vector>
#include <map>

template<typename T>
bool rMin(T& a, const T& b){
    if(b < a){
        a = b;
        return true;
    }
    return false;
}

template<typename T>
bool rMax(T& a, const T& b){
    if(a < b){
        a = b;
        return true;
    }
    return false;
}

using namespace std;

struct Symbol {
    char c;
    bool check;
};

vector<int> dx = {0, 1, 1, 1, 0, -1, -1, -1};
vector<int> dy = {1, 1, 0, -1, -1, -1, 0, 1};
vector<vector<Symbol>> s(12, vector<Symbol>(12, {'.', false}));

int f(int i, int j, int pi, int pj) {
    int ind = 0, cnt = 0;

    for (int k = 0; k < dx.size(); ++k) {
        int ik = i + dy[k], jk = j + dx[k];
        if (ik == pi && jk == pj) continue;
        if (s[ik][jk].c == '#') {
            ind = k;
            cnt++;
        }
    }
    if (cnt == 2 && s[i + dy[(ind + 4) % 8]][j + dx[(ind + 4) % 8]].c != '#'
        || cnt > 2) {
        return -1;
    }
    if (cnt == 0)
        return 1;
    int neigh1 = f(i + dy[ind], j + dx[ind], i, j);
    if (neigh1 == -1)
        return -1;
    if (cnt == 1) {
        return neigh1 + 1;
    }
    int neigh2 = f(i + dy[(ind + 4) % 8], j + dx[(ind + 4) % 8], i, j);
    if (neigh2 == -1)
        return -1;
    if (cnt == 2)
        return neigh1 + 1 + neigh2;
}

void bad(){
    cout << "NO\n";
    exit(0);
}

int _dx[] = {0, 0, 1, -1};
int _dy[]{1, -1, 0, 0};

int cnt(int x, int y, int d){
    int ans = 0;
    while(s[x + _dx[d]][y + _dy[d]].c == '#'){
        x += _dx[d];
        y += _dy[d];
        ++ans;
    }
    return ans;
}

int palub(int x, int y){
    vector<int> res(4);
    for(int i = 0; i < 4; ++i){
        res[i] = cnt(x, y, i);
    }
    if((res[0] != 0 || res[1] != 0) && (res[2] != 0 || res[3] != 0)){
        bad();
    }
    if(res[0] + res[1] + res[2] + res[3] >= 4)
        bad();

    int x1 = x - res[3], y1 = y - res[1], x2 = x + res[2], y2 = y + res[0];
    for(int i = x1 - 1; i <= x2 + 1; ++i){
        if(s[i][y1 - 1].c == '#' || s[i][y2 + 1].c == '#')
            bad();
    }
    for(int i = y1 - 1; i <= y2 + 1; ++i){
        if(s[x1 - 1][i].c == '#' || s[x2 + 1][i].c == '#')
            bad();
    }
    return res[0] + res[1] + res[2] + res[3] + 1;

}



void solve(){
    int n = 10;

    vector<int> cnts(5);
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++)
            cin >> s[i][j].c;
    }
    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; ++j) {
            if (s[i][j].c == '#') {
                int count = palub(i, j);
                cnts[count]++;
            }
        }
    }
    for (int i = 1; i <= 4; i++) {
        if (cnts[i] / i != 5 - i) {
            cout << "NO" << endl;
            return;
        }
    }
    cout << "YES" << '\n';
}

int main(){
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#endif
    int t = 1;

    //cin >> t;

    for(int i = 0; i < t; ++i){
        solve();
    }
}