#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, '.'));
    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] == '#') {
                ll cnt = 0;
                if (a[i - 1][j - 1] == '#') cnt++;
                if (a[i - 1][j] == '#') cnt++;
                if (a[i - 1][j + 1] == '#') cnt++;
                if (a[i][j - 1] == '#') cnt++;
                if (a[i][j + 1] == '#') cnt++;
                if (a[i + 1][j - 1] == '#') cnt++;
                if (a[i + 1][j] == '#') cnt++;
                if (a[i + 1][j + 1] == '#') cnt++;
                if (cnt > 1) {
                    if (cnt == 2) {
                        if ((a[i + 1][j] == '#' && a[i - 1][j] == '#') || (a[i][j - 1] == '#' && a[i][j + 1] == '#')){}
                        else {
                            std::cout << "NO";
                            return;
                        }
                    } else {
                        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();
    }
}
