#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>

#ifndef Debug
#pragma GCC optimize("O3")
#endif

using ll = long long;

void bipkos() {
    ll n = 10;
    std::vector<std::vector<char>> a(n + 2, std::vector<char>(n + 2, '.'));
    std::map<ll, ll> cnt;
    for (ll i = 1; i < n + 1; i++) for (ll j = 1; j < n + 1; j++) std::cin >> a[i][j];
    for (ll i = 1; i < n + 1; i++) {
        for (ll j = 1; j < n + 1; j++) {
            if (a[i][j] == '#') {
                if (a[i - 1][j - 1] == '#' || a[i - 1][j + 1] == '#' || a[i + 1][j - 1] == '#' || a[i + 1][j + 1] == '#') {
                    std::cout << "NO";
                    return;
                }
                ll cnt_up_down = 0, cnt_right_left = 0;
                // up
                ll i1 = i - 1;
                while (i1 >= 1 && a[i1][j] == '#') cnt_up_down++, i1--;
                //down
                i1 = i + 1;
                while (i1 <= n && a[i1][j] == '#') cnt_up_down++, i1++;
                // left
                ll j1 = j - 1;
                while (j1 >= 1 && a[i][j1] == '#') cnt_right_left++, j1--;
                // right
                j1 = j + 1;
                while (j1 <= n && a[i][j1] == '#') cnt_right_left++, j1++;
                if ((cnt_right_left != 0 && cnt_up_down != 0)) {
                    std::cout << "NO";
                    return;
                }
                cnt[std::max(cnt_up_down, cnt_right_left) + 1]++;
            }
        }
    }
    if (cnt.size() != 4 || cnt[1] != 4 || cnt[2] != 6 || cnt[3] != 6 || cnt[4] != 4) {
        std::cout << "NO";
        return;
    }
    std::cout << "YES";
}

int main() {
    std::cin.tie(nullptr), std::ios::sync_with_stdio(false);
    int t = 1;
//    std::cin >> t;
    while (t--) {
        bipkos();
    }
}
