#include <bits/stdc++.h>

using namespace std;
using ull = unsigned long long;
using ld = long double;
using ll = long long;
using PII = pair<int, int>;
using PLL = pair<long long, long long>;
using PSS = pair<string, string>;
using ui = unsigned int;

#define fast_io ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define lb(set, x) set.lower_bound(x)
#define ub(set, x) set.upper_bound(x)

const ll INF = 1e18;
const ll MOD = 1e9 - 7;

vector<vector<int>> graph;
vector<vector<bool>> visited;

int len = 0;
void dfs(int x, int y) {
    visited[x][y] = true;
    bool vert = false, gor = false, ugol = false;
    if (len != -1) {
        len++;
    }

    if (graph[x + 1][y + 1] == 1 || graph[x + 1][y - 1] == 1 || graph[x - 1][y - 1] == 1 || graph[x - 1][y + 1] == 1) ugol = true;

    if (!visited[x + 1][y] && graph[x + 1][y] == 1) {
        vert = true;
        dfs(x + 1, y);
    }
    if (!visited[x - 1][y] && graph[x - 1][y] == 1) {
        vert = true;
        dfs(x - 1, y);
    }
    if (!visited[x][y + 1] && graph[x][y + 1] == 1) {
        gor = true;
        dfs(x, y + 1);
    }
    if (!visited[x][y - 1] && graph[x][y - 1] == 1) {
        gor = true;
        dfs(x, y - 1);
    }

    if (gor && vert || ugol) {
        len = -1;
    }
}

void solve() {
    graph.resize(12, vector<int>(12, 0));
    for (int i = 1; i <= 10; ++i) {
        string s;
        cin >> s;

        for (int j = 0; j < 10; ++j)
            if (s[j] == '#')
                graph[i][j + 1] = 1;
    }

    //    for(auto el : graph) {
    //        for(auto it : el) {
    //            cout << it;
    //        }
    //        cout << endl;
    //    }

    int count = 0;
    vector<int> cs;
    visited.resize(12, vector<bool>(12, false));
    for (int i = 1; i <= 10; ++i) {
        for (int j = 1; j <= 10; ++j) {
            //            cout << visited[i][j] << ' ' << graph[i][j] << endl;
            if (!visited[i][j] && graph[i][j] == 1) {
                //                cout << 1 << ' ';
                dfs(i, j);
                if (len != -1) {
                    cs.push_back(len);
                    count++;
                }
                len = 0;
            }
        }
    }

    int four = 0, three = 0, two = 0, one = 0;

    for (auto el : cs) {
        if (el == 4) four++;
        else if (el == 3) three++;
        else if (el == 2) two++;
        else if (el == 1) one++;
    }

    bool a;
    if (count == 10 && four == 1 && three == 2 && two == 3 && one == 4) {
        a = true;
    }
    else {
        a = false;
    }

    //    cout << count << endl;

    //    cout << four << ' ' << three << ' ' << two << ' ' << one << endl;

    if (a) {
        cout << "YES";
    }
    else {
        cout << "NO";
    }
}

signed main() {
    fast_io;
    solve();
    return 0;
}