#include <bits/stdc++.h>
#define forEach(vec, i) for (auto i = vec.begin(); i < vec.end(); ++i)
#define ASSERT(x)       {if (!(x)) {cout << "NO" << endl; return 0;}}

using namespace std;

typedef unsigned long long int ulli;
typedef long long int ll;

int main() {
    cin.sync_with_stdio(0); cin.tie(0);
    cout.sync_with_stdio(0);
    char a[10][10];
    for (int i=0; i<10; ++i) {
        string s;
        cin >> s;
        for (int j=0; j<10; ++j) a[i][j] = s[j];
    }
    int boats[5] = {-1000, 4, 3, 2, 1};
    for (int i=0; i<10; ++i) {
        for (int j=0; j<10; ++j) {
            if (a[i][j] != '#') continue;
            int i_ = i, j_ = j, s1=0;
            // By row
            while (a[i][j_] == '#') {
                if (j_ == 10) break;
                if (i < 9) ASSERT(a[i+1][j_+1] == '.' && (j_ == 0 || a[i+1][j_-1] == '.'));
                a[i][j_] = '$';
                s1++;
                j_++;
            }
            ASSERT(s1<5);
            // By column
            int s2=0;
            a[i][j] = '#';
            while (a[i_][j] == '#') {
                if (i_ == 10) break;
                if (i < 9) ASSERT(a[i_+1][j+1] == '.' && (j == 0 || a[i_+1][j-1] == '.'));
                a[i_][j] = '$';
                s2++;
                i_++;
            }
            a[i][j] = '$';
            ASSERT(s2<5);
            if (s2 > s1) swap(s1,s2);
            ASSERT(s2 == 1);
            boats[s1]--;
        }
    }
    ASSERT(boats[1] == 0 && boats[2] == 0 && boats[3] == 0 && boats[4] == 0);
    cout << "YES" << endl;
    return 0;
}
