#include <bits/stdc++.h>
#define fi first
#define se second

using namespace std;
typedef long long ll;

const int n = 10;
vector <vector <int>> a(n + 2, vector <int> (n + 2, 0));

bool square(int i, int j) {
    if (a[i - 1][j - 1])
        return false;
    if (a[i - 1][j] && a[i - 1][j] != a[i][j])
        return false;
    if (a[i - 1][j + 1])
        return false;
    if (a[i][j - 1] && a[i][j - 1] != a[i][j])
        return false;
    return true;
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    for (int i = 1; i <= n; i++) {
        for (int j = 1; j <= n; j++) {
            char c;
            cin >> c;
            if (c == '#')
                a[i][j] = 1;
        }
    }
    int cnt4 = 0, cnt3 = 0, cnt2 = 0, cnt1 = 0, i = 1, j = 1, color = 2;
    while (i <= n) {
        j = 1;
        while (j <= n) {
            if (a[i][j] == 1) {
                if (!square(i, j)) {
                    cout << "NO";
                    return 0;
                }
                int tmp = 0, y = i + 1, x = j;
                while (a[i][x] == 1 && x <= n && tmp < 4) {
                    a[i][x] = color;
                    tmp++;
                    x++;
                }
                if (tmp == 1) {
                    while (a[y][j] == 1 && y <= n && tmp < 4) {
                        a[y][j] = color;
                        tmp++;
                        y++;
                    }
                    j++;
                } else {
                    j = x;
                }
                if (tmp == 1)
                    cnt1++;
                else if (tmp == 2)
                    cnt2++;
                else if (tmp == 3)
                    cnt3++;
                else if (tmp == 4)
                    cnt4++;
                color++;
            } else {
                j++;
            }
        }
        i++;
    }
    if (cnt1 == 4 && cnt2 == 3 && cnt3 == 2 && cnt4 == 1) {
        cout << "YES";
    } else {
        cout << "NO";
    }
    cout << '\n';
}
