#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <list>
#include <set>
#include <map>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <cassert>
#include <random>
#include <chrono>
#include <tuple>
using namespace std;

#pragma GCC optimize("03")
#pragma GCC target("avx2")

using ll = long long;
using ull = unsigned long long;
using ld = long double;
using ii = int;

const ii N = 10;

bool answer = false;

void dfs(ii i, ii j, ii cnt, vector<vector<ii>> &yard, vector<vector<bool>> &used, vector<ii> &ship_sizes) {
    if (answer) return;
    used[i][j] = true;
    bool flag = false;
    if (yard[i + 1][j] && !used[i + 1][j]) {
        flag = true;
        dfs(i + 1, j, cnt + 1, yard, used, ship_sizes);
    }
    if (yard[i - 1][j] && !used[i - 1][j]) {
        flag = true;
        dfs(i - 1, j, cnt + 1, yard, used, ship_sizes);
    }
    if (yard[i][j + 1] && !used[i][j + 1]) {
        flag = true;
        dfs(i, j + 1, cnt + 1, yard, used, ship_sizes);
    }
    if (yard[i][j - 1] && !used[i][j - 1]) {
        flag = true;
        dfs(i, j - 1, cnt + 1, yard, used, ship_sizes);
    }
    if (yard[i - 1][j - 1] || yard[i + 1][j + 1] || yard[i + 1][j - 1] || yard[i - 1][j + 1]) {
        answer = true;
        return;
    }
    if (!flag) {
        ship_sizes[cnt - 1]++;
    }
}

using namespace std;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    vector<vector<ii>> yard(N + 2, vector<ii>(N + 2, 0));
    for (ii i = 1; i <= N; i++) {
        for (ii j = 1; j <= N; j++) {
            char c; cin >> c;
            if (c == '#') {
                yard[i][j] = 1;
            }
        }
    }
    vector<vector<bool>> used(N + 2, vector<bool>(N + 2, false));
    vector<ii> ship_sizes(4, 0);
    for (ii i = 1; i <= N; i++) {
        if (answer) {
            cout << "NO";
            return 0;
        }
        for (ii j = 1; j <= N; j++) {
            if (answer) {
                cout << "NO";
                return 0;
            }
            if (yard[i][j] == 1 && (!used[i][j])) {
                dfs(i, j, 1, yard, used, ship_sizes);
            }
        }
    }
    if (ship_sizes[0] == 4 && ship_sizes[1] == 3 && ship_sizes[2] == 2 && ship_sizes[3] == 1) {
        cout << "YES";
        return 0;
    }
    else {
        cout << "NO";
        return 0;
    }
}
