#include <bits/stdc++.h>
#define int long long
#define ff first
#define ss second
#define pb push_back
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define no1 cout<<"-1\n"

using namespace std;

const int N = 15;
const int INF = 1e18;
const int mod = 1e9+7;

// int binpow (int a, int n) {
// 	if (n == 0)
// 		return 1;
// 	if (n % 2 == 1)
// 		return (binpow (a, n-1)%mod * a%mod)%mod;
// 	else {
// 		int b = binpow (a, n/2) % mod;
// 		return (b%mod * b%mod)%mod;
// 	}
// }

char a[N][N];
bool was[N][N];

void solve(){
    for(int i = 1;i<=10;i++){
        for(int j = 1;j<=10;j++){
            cin>>a[i][j];
        }
    }
    int cnt4 = 0;
    int cnt3 = 0;
    int cnt2 = 0;
    int cnt1 = 0;
    for(int i = 1;i<=10;i++){
        for(int j = 1;j<=10;j++){
            if(a[i][j] == '#' && !was[i][j]){
                int cnt = 0;
                if(a[i+1][j] == '#'){
                    if(a[i-1][j] == '#' ){
                        no;
                        return;
                    }
                    for(int x = i, y = j; x<=10 && y<=10; x++){
                        was[x][y] = 1;
                        cnt++;
                        if(a[x-1][y-1] == '#' || a[x-1][y+1] == '#' || a[x][y-1] == '#' || a[x][y+1] == '#'){

                            no;
                            return;
                        }
                        if(a[x+1][y] != '#'){
                            if(a[x+1][y+1] == '#' || a[x+1][y-1] == '#'){

                                no;
                                return;
                            }
                            break;
                        }
                    }
                }
                else{
                    if(a[i][j-1] == '#' ){
                        no;
                        return;
                    }
                    for(int x = i, y = j; x<=10 && y<=10; y++){
                        was[x][y] = 1;
                        cnt++;
                        if(a[x-1][y-1] == '#' || a[x+1][y] == '#' || a[x+1][y-1] == '#' || a[x+1][y] == '#'){
                            no;
                            return;
                        }
                        if(a[x][y+1] != '#'){
                            if(a[x+1][y+1] == '#' || a[x-1][y+1] == '#'){

                                no;
                                return;
                            }
                            break;
                        }
                    }
                }
                if(cnt == 4) cnt4++;
                else if(cnt == 3) cnt3++;
                else if(cnt == 2) cnt2++;
                else if(cnt == 1) cnt1++;
                else{
                    no;
                    return;
                }
            }
        }
    }
    if(cnt4 == 1 && cnt3 == 2 && cnt2 == 3 && cnt1 == 4){
        yes;
    }
    else{
        no;
    }
}       



signed main(){
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    // cout.tie(nullptr);
    int t = 1; 
    // cin>>t;
    // cout<<"";
    for(int i = 1;i<=t;i++){
        solve();
    }
}