//#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
#define ent "\n"
#define int long long
#define f first
#define s second

const int maxn = 2e5 + 100;
const int inf = (int)1e9 + 100;
const ll INF = (ll)1e18;
const int MOD = 1e9 + 7;
const int maxl = 20;
const ll P = 31;

int n, m;
int cnt[10];
char c[11][11];

signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    int t; t = 1;
    n = m = 10;
    int sum = 0;
    for(int i=1; i<=n; i++){
        for(int j=1; j<=m; j++){
            cin >> c[i][j];
            sum += (c[i][j] == '#');
        }
    }
    if(sum != 20){
        cout << "NO";
        return 0;
    }
    for(int len=4; len>0; len--){
        for(int i=1; i<=n; i++){
            for(int j=1; j<=m-len+1; j++){
                int ok = 1;
                for(int k=j; k<j+len; k++){
                    if(c[i][k] == '.') ok = 0;
                    if(c[i-1][k] == '#') ok = 0;
                    if(c[i+1][k] == '#') ok = 0;
                }
                if(c[i-1][j-1] == '#') ok = 0;
                if(c[i+1][j-1] == '#') ok = 0;
                if(c[i-1][j+len] == '#') ok = 0;
                if(c[i+1][j+len] == '#') ok = 0;
                if(ok && c[i][j-1] != '#' && c[i][j+len] != '#') cnt[len]++;
            }
        }
        for(int j=1; j<=m; j++){
            for(int i=1; i<=n-len+1; i++){
                int ok = 1;
                for(int k=i; k<i+len; k++){
                    if(c[k][j] == '.') ok = 0;
                    if(c[k][j-1] == '#') ok = 0;
                    if(c[k][j+1] == '#') ok = 0;
                }
                if(c[i-1][j-1] == '#') ok = 0;
                if(c[i-1][j+1] == '#') ok = 0;
                if(c[i+len][j-1] == '#') ok = 0;
                if(c[i+len][j+1] == '#') ok = 0;
                if(ok && c[i-1][j] != '#' && c[i+len][j] != '#') cnt[len]++;
            }
        }
    }
    if(cnt[4] == 1 && cnt[3] == 2 && cnt[2] == 3 && cnt[4] == 1) cout << "YES";
    else cout << "NO";
}
