// BEST TEACHERS: NAZAROV SHARAF and USMONZODA SOMON
//                littbird           another_love
#include <bits/stdc++.h>
#define ONLINE_JUDGE
#define fi first
#define se second
#define pb push_back
#define yes cout << "YES"
#define no cout << "NO"
#define int long long
#define in insert
#define endl '\n'
#define ld long double
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
using namespace std;
void solve() {
    vector<int>cnt(4);
    int n = 10,m = 10;
    vector< vector<int> >a(50,vector<int>(50));
    for(int i = 1;i <= n;i ++) {
        for(int j = 1;j <= m;j ++){
            char x;
            cin >> x;
            a[i][j] = x == '#';
        }
    }
    for(int y = 0 ;y < cnt.size() ;y ++){
        int x = y + 1;
        int salamalek = x + 2;
        for(int i = 1; i<= n;i ++) {

            for(int j = 0;j <= m;j ++) {
                bool ok = true;
                for(int k = 0;k < salamalek;k++){
                    if(a[i - 1][j + k] or a[i + 1][j + k])ok = false;
                }
                if(a[i][j] or a[i][j + x + 1])ok =false;
                for(int k = 1;k + 1 < salamalek;k++){
                    if(!a[i][j + k])ok = false;
                }
                if(ok) {
                    for(int k = 1;k + 1 < salamalek;k++){
                        a[i][j + k] = 0;
                    }
                    cnt[y]++;
                }
            }
        }
    }
    for(int y = 0 ;y < cnt.size() ;y ++){
        int x = y + 1;
        int salamalek = x + 2;
        for(int i = 0; i<= n;i ++) {
            for(int j = 1;j <= m;j ++) {
                bool ok = true;
                for(int k = 0;k < salamalek;k++){
                    if(a[i + k][j - 1] or a[i + k ][j+ 1])ok = false;
                }
                if(a[i][j] or a[i + x + 1][j])ok =false;
                for(int k = 1;k + 1 < salamalek;k++){
                    if(!a[i + k][j])ok = false;
                }
                if(ok) {
                    cnt[y]++;
                }
            }
        }
    }
    if(cnt[0] == 4 and cnt[1] == 3 and cnt[2] == 2 and cnt[3] == 1) {
        yes;
    }
    else{
        no;
    }
}
signed main() {
#ifndef ONLINE_JUDGE
    // For getting input from input.txt file
    freopen("input.txt", "r", stdin);
    // Printing the Output to output.txt file
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int tt = 1;
   // cin >> tt;
    for (int q = 1; q <= tt; q++) {
        solve();
        cout << endl;
    }
}
