#include <bits/stdc++.h>

#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()

#define fi first
#define se second
#define pb push_back
#define fr(i, l, r) for (int i = (l); i <= (r); i++)

using namespace std;
typedef long long ll;

char c[20][20];
int cnt[5];

void solve() {
    int n = 10;

    for (int i = 0; i <= 12; i++) {
        for (int j = 0; j <= 12; j++) {
            c[i][j] = '&';
        }
    }
    for (int i = 1; i <= 10; i++) {
        for (int j = 1; j <= 10; j++) {
            cin >> c[i][j];
        }
    }

    fr (i, 1, n)
    {
        fr (j, 1, n)
        {
            if(c[i][j] == '#')
            {
                if(i < 10 && j < 10 && c[i + 1][j + 1] == '#')
                {
                    cout << "NO\n";
                    return;
                }
                if(i < 10 && j > 1 && c[i + 1][j - 1] == '#')
                {
                    cout << "NO\n";
                    return;
                }
            }
        }
    }

    int cnt[5];
    cnt[1] = 4;
    cnt[2] = 3;
    cnt[3] = 2;
    cnt[4] = 1;
    fr (i, 1, n)
    {
        fr (j, 1, n)
        {
            if(c[i][j] == '#')
            {
                int Size = 0;
                bool flag = 0;
                if(c[i][j + 1] == '#')
                {
                    int y = j;
                    while(y <= 10 && c[i][y] == '#')
                    {
                        c[i][y] = '.';
                        Size++;
                        y++;
                    }
                    flag = 1;
                }
                if(c[i + 1][j] == '#')
                {
                    if (flag == 1) {
                        cout << "NO\n";
                        return;
                    }
                    flag = 1;
                    int x = i;
                    while(x <= 10 && c[x][j] == '#')
                    {
                        c[x][j] = '.';
                        Size++;
                        x++;
                    }
                }
                if (flag == 0) {
                    Size++;
                }

                //cout << Size << endl;

                if(Size > 4)
                {
                    cout << "NO\n";
                    return;
                }

                cnt[Size]--;

                if(cnt[Size] < 0)
                {
                    cout << "NO\n";
                    return;
                }
            }
        }
    }

    fr (i, 1, 4)
    {
        if(cnt[i] > 0)
        {
            cout << "NO\n";
            return;
        }
    }

    cout << "YES\n";
    return;
}

int main() {
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);

    ios_base::sync_with_stdio(0);
    cin.tie(0);

    solve();

    return 0;
}
