#include <bits/stdc++.h>
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pll pair<long long, long long>
#define vl vector<ll>
#define pstr pair<string, string>
#define lli long long int
#define ll long long
#define ld long double
#define ull unsigned long long
#define sz size()
#define pb push_back
#define pob pop_back
#define pf push_front
#define ff first
#define ss second
#define F first
#define S second
#define mk make_pair
#define fr front()
#define PI 3.14159265358979323846
using namespace std;
const ll MOD = 1e9 + 7;
const ll N = 1e6 + 5;
const ll inf = 1e18;
const ll maxsize = 105;

ll binpow(ll a, ll b){
    if(b == 1) return a;
    ll z = binpow(a, b / 2);
    if(b % 2 == 0) return (z * z);
    else return (z * z) * a ;
}

ll binpow_m(ll a, ll b){
    if(b == 1) return a % MOD;
    ll z = binpow(a, b / 2);
    if(b % 2 == 0) return (z * z) % MOD;
    else return (z * z) % MOD * a % MOD;
}

ll lcm(ll a, ll b) {
    return (a / __gcd(a, b)) * b;
}

ll Prime(unsigned long a, unsigned long j){
   return j * j <= a ? (a % j) && Prime(a, j + 1) : 1;
}

bool isPrime(ll n){
    for(ll i = 2; i <= sqrt(n); i++){
        if(n % i == 0){
            return false;
        }
    }
    return true;
}

int main(/*d!ZzAsTer?*/)
{
    boost;
    //freopen(".in", "r", stdin);
    //freopen(".out", "w", stdout);
    char c[12][12];
    bool ok[12][12];
    ll k[5];
    k[1]=4,k[2]=3,k[3]=2,k[4]=1;
    for(ll i = 1; i <= 10; i++){
        for(ll j = 1; j <= 10; j++){
            cin >> c[i][j];
            ok[i][j] = 1;
        }
    }
    for(ll i = 1; i <= 10; i++){
        for(ll j = 1; j <= 10; j++){
            if(c[i][j]=='#'&&ok[i][j]){
                ll x=1,y=1;
                bool b=0;
                if(c[i-1][j-1]=='#')b=1;
                if(c[i-1][j+1]=='#')b=1;
                if(c[i+1][j-1]=='#')b=1;
                for(ll i2=1;i+i2<=10;i2++){
                    if(c[i+i2][j]=='#'){
                        x++, ok[i+i2][j]=0;
                        if(c[i+i2][j-1]=='#'||c[i+i2][j+1]=='#') b=1;
                    }else{
                        if(c[i+i2][j-1]=='#')b=1;
                        if(c[i+i2][j+1]=='#')b=1;
                        break;
                    }
                }
                for(ll i2=1;j+i2<=10;i2++){
                    if(c[i][j+i2]=='#'){
                        x++, ok[i][j+i2]=0;
                        if(c[i-1][j+i2]=='#'||c[i+1][j+i2]=='#')b=1;
                    }else{
                        if(c[i+1][j+i2]=='#')b=1;
                        if(c[i-1][j+i2]=='#')b=1;
                        break;
                    }
                }
                if(b||min(x,y)>1||max(x,y)>4){cout<<"NO";return 0;}
                k[max(x,y)]--;
            }
        }
    }
    if(k[1]!=0||k[2]!=0||k[3]!=0||k[4]!=0) cout<<"NO";
    else cout<<"YES";
    return 0;
}
