#include <bits/stdc++.h>

using namespace std;

#define int long long

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

bool check(int x, int y) {
    return x>=0 and x<10 and y>=0 and y<10;
}

signed main() {
    vector<vector<char>> v(10, vector<char>(10));
    int n=10;
    for (int i=0; i<n; i++) {
        for (int j=0; j<n; j++) {
            cin >> v[i][j];
        }
    }
    vector<vector<bool>> used(10, vector<bool>(10));
    vector<int> cnt(5);
    bool good=true;
    for (int i=0; i<n; i++) {
        for (int j=0; j<n; j++) {
            int x=i, y=j;
            if (v[x][y]=='#' and !used[x][y]) {
                used[x][y]=1;
                pair<int, int> nap;
                int cnt_sn=0;
                for (int k=0; k<8; k++) {
                    if (check(x+dx[k], y+dy[k])) {
                        if (v[x+dx[k]][y+dy[k]]=='#') {
                            cnt_sn++;
                            used[x+dx[k]][y+dy[k]]=1;
                            nap={dx[k], dy[k]};
                        }
                    }
                }
                if (cnt_sn>1) {
                    good=false;
                    break;
                }
                else if (cnt_sn==1) {
                    int c=1;
                    bool cont=true;
                    int d_x=nap.first;
                    int d_y=nap.second;
                    while (check(x, y) and v[x][y]=='#') {
                        used[x][y]=1;
                        x+=d_x;
                        y+=d_y;
                        if (!check(x, y) or v[x][y]!='#') {
                            cont=false;
                            break;
                        }
                        c++;
                        int cnt_s=0;
                        for (int k=0; k<8; k++) {
                            if (check(x+dx[k], y+dy[k])) {
                                int X=x+dx[k], Y=y+dy[k];
                                if (v[X][Y]=='#' and !used[X][Y]) {
                                    cnt_s++;
                                    used[X][Y]=1;
                                    if (nap.first!=dx[k] or nap.second!=dy[k]) {
                                        good=false;
                                        break;
                                    }
                                }
                            }
                        }
                        if (cnt_s>1) {
                            good=false;
                            break;
                        }
                    }
                    if (c>5) {
                        good=false;
                        break;
                    }
                    cnt[c]++;
                }
                else {
                    cnt[1]++;
                }
            }
        }
    }
    if (!good) {
        cout<<"NO";
        return 0;
    }
    else {
        for (int i=1; i<=4; i++) {
            if (cnt[i]!=4-i+1) {
                cout<<"NO\n";
                return 0;
            }
        }
        cout<<"YES\n";
    }
}
