#include <bits/stdc++.h>

using namespace std;
#define ll long long

vector<vector<int>> field(12, vector<int>(12, 0));
vector<vector<bool>> checked(12, vector<bool>(12, false));

bool correct(int i, int j) {
    return (field[i - 1][j - 1] + field[i - 1][j + 1] + field[i + 1][j + 1] + field[i + 1][j - 1]) == 0;
}

bool isstrart(int i, int j) {
    int ans = 0;
    ans += field[i - 1][j];
    ans += field[i][j + 1];
    ans += field[i + 1][j];
    ans += field[i][j - 1];

    if (ans <= 1 && field[i][j]) return true;
    return false;
}

int direction(int i, int j) {
    if (field[i - 1][j] || field[i + 1][j]) {
        return 1;
    }
    return 0;
}

int main(){

    vector<int> c(5, 0);
    
    for (int i = 1; i < 11; i++) {
        for (int j = 1; j < 11; j++) {
            char a; cin >> a;
            field[i][j] = (int)(a == '#');
        }
    }

    for (int i = 1; i < 11; i++) {
        for (int j = 1; j < 11; j++) {
            if (field[i][j]) {
                if (!correct(i, j)){
                    cout << "NO\n";
                    return 0;
                }
                if (!checked[i][j]) {
                    if (isstrart(i, j)) {
                        int cnt = 1;
                        int y = i, x = j;
                        if (direction(i, j)) {
                            y++;
                            while (field[y][x]) {
                                checked[y][x] = 1;
                                if (field[i][j + 1] || field[i][j - 1] || !correct(y, x)) {
                                    cout << "NO\n";
                                    return 0;
                                }
                                y++;
                                cnt++;
                            }
                        }
                        else {
                            x++;
                            while (field[y][x]) {
                                checked[y][x] = 1;
                                if (field[i - 1][j] || field[i + 1][j] || !correct(y, x)) {
                                    cout << "NO\n";
                                    return 0;
                                }
                                x++;
                                cnt++;
                            }
                        }
                        if (cnt <= 4) {
                            c[cnt]++;
                        }
                        else {
                            cout << "NO\n";
                            return 0;
                        }
                    }
                }
            }
            checked[i][j] = 1;
        }
    }

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

    return 0;
}