#include <bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
  
const ll N = 1e6 + 5;
const ll mod = 1e9 + 7;
const ll inf = 1e18;
char a[11][11];

bool check(int x) {
    for (int i = 1; i < 10; ++i) {
        for (int j = 1; j < 10; ++j) {
            if ((a[i][j] == '#' && a[i + 1][j + 1] == '#') || (a[i][j + 1] == '#' && a[i + 1][j] == '#')) {
                return false;
            }
        }
    }

    for (int l = 4; l >= 0; --l) {
        int c = 0;
        for (int i = 1; i <= 10; ++i) {
            for (int j = 1; j + l <= 10; ++j) {
                bool Row = true;
                bool Col = true;

                for (int k = 0; k <= l; ++k) {
                    Row &= (a[i][j + k] == '#');
                }

                if (Row) {
                    c++;
                    for (int k = 0; k <= l; ++k) {
                        a[i][j + k] = '.';
                    }
                    // cout << c << " -> " << l << "\n";
                }

                for (int k = 0; k <= l; ++k) {
                    Col &= (a[j + k][i] == '#');
                }

                if (Col) {
                    c++;
                    for (int k = 0; k <= l; ++k) {
                        a[j + k][i] = '.';
                    }
                }
            }
        }

        if (l == 4 && c) {
            return false;
        }

        if (l + c != 4) {
            return false;
        }
    }

    return true;
}


int main() {
    char s;
    for (int i = 1; i <= 10; ++i) {
        for (int j = 1; j <= 10; j++) {
            cin >> s;
            a[i][j] = s;
        }
    }
    bool result = check(1);
    if (result == true) {
        cout << "YES";
    }
    else {
        cout << "NO";
    }

    return 0;
}
