#include "bits/stdc++.h"

using namespace std;

#define int long long

void solve(){
    int n = 10;

    vector<string> s(n);
    map<pair<int,int>,bool> used;
    map<pair<int,int>,bool> used1;
    map<int,int> d;

    for (int i = 0;i < n;i++){
        cin >> s[i];
    }

    for (int i = 0;i < n;i++){
        for (int j = 0;j < n;j++){
            int cnt1 = 0,cnt2 = 0;
            int i1 = i,j1 = j;
            while (i1 < n and s[i1][j] == '#' and !used[pair<int,int>(i1,j)]){
                used[{i1,j}] = true;
                i1++;
                cnt1++;
            }
            while (j1 < n and s[i][j1] == '#' and !used1[pair<int,int>(i,j1)]){
                used1[{i,j1}] = true;
                j1++;
                cnt2++;
            }

            if ((cnt1 == 1 or cnt2 == 1) and !(cnt1 == 1 && cnt2 == 1) and cnt1 != cnt2){
                if (max(cnt1,cnt2) != 1)
                    d[max(cnt1,cnt2)]++;
            }

            if (s[i][j] == '#'){
                if (i == 0 or s[i - 1][j] != '#'){
                    if (j == 0 or s[i][j - 1] != '#'){
                        if (i == n - 1 or s[i + 1][j] != '#'){
                            if (j == n - 1 or s[i][j + 1] != '#'){
                                d[1]++;
                            }
                        }
                    }
                }
            }
        }
    }
    if (d[4] == 1 and d[3] == 2 and d[2] == 3 and d[1] == 4 and d.size() == 4){
        cout << "YES\n";
        return;
    }
    cout << "NO\n";
}

signed main() {
#ifdef LOCAL
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#else
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
#endif
    int t = 1;
//    cin >> t;

    while (t--) solve();
}
