#include <bits/stdc++.h>
using namespace std;
 
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
 
// using namespace __gnu_pbds;
  
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
// find_by_order
// order_of_key
 
#define pb push_back
#define mk make_pair
#define f first
#define s second
#define vt vector
#define y1 ggwp
#define rt return
#define br break
#define cn continue
#define en '\n'
#define yes cout << "YES\n";
#define no cout << "NO\n"
#define yesno(x); cout << (x ? "YES\n" : "NO\n");
#define dbg(x) cout << (#x) << ": " << (x) << '\n';
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define rev(x) reverse(x.begin(), x.end())
#define sz(x) (int)x.size()
#define left stupid_left
#define right stupid_right
 
template<class T, class TT> void mineq(T& a, const TT& b){ if (b < a) a = b;}
template<class T, class TT> void maxeq(T& a, const TT& b){ if (b > a) a = b;}
 
#define fast_io ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0) 
#define file_io freopen(".in", "r", stdin); freopen(".out", "w", stdout)
 
typedef double ld;
typedef long long ll;
typedef vector<int> vi; 
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<pair<int, int>> vii;
typedef vector<pair<ll, ll>> vll;
    
vii dir = {
    {1, 0},
    {-1, 0},
    {0, 1},
    {0, -1}
};

vt<string> ar(10);
int used[10][10], comp[10][10], comp_cnt = 0, sz = 0;
bool ok = 1;
set<pii> st;
vt<set<int>> vec;

bool chk(int i, int j){
    rt (0 <= i && i < 10 && 0 <= j && j < 10);
}

void dfs(int i, int j, int comp_num){
    used[i][j] = 1;
    comp[i][j] = comp_cnt;
    sz++;
    st.insert({i, j});
    for(auto d : dir){
        int toi = i + d.f, toj = j + d.s;
        if(chk(toi, toj) && ar[toi][toj] == '#'){
            if(!used[toi][toj]){
                dfs(toi, toj, comp_num);
            }
        }
    }
}

void solve(){
    int ans = 0;
    map<int, int> mp;
    for(int i = 0;i < 10;i++){
        for(int j = 0;j < 10;j++){
            if(ar[i][j] == '#' && !used[i][j]){
                
                st.clear();
                sz = 0;
                dfs(i, j, comp_cnt);
                mp[sz]++;
                comp_cnt++;

                bool is1 = 1, is2 = 1;
                pii bg = *st.begin();
                for(auto p : st){
                    is1 &= (p.f == bg.f);
                    is2 &= (p.s == bg.s);
                }

                if(is1 || is2){
                    cn;
                }else{

                    // for(auto p : st){
                    //     cout << p.f << " - " << p.s << en;
                    // }

                    cout << "NO"; exit(0);
                }

            }
        }
    }
    // dbg(comp_cnt);
    // for(auto x : mp) cout << x.f << " : " << x.s << en;
    // cout << en;

    for(int i = 0;i < 9;i++){
        for(int j = 0;j < 9;j++){

            if(ar[i][j] == '#' && ar[i + 1][j + 1] == '#'){
                cout << "NO"; exit(0);
            }

            if(ar[i][j + 1] == '#' && ar[i + 1][j] == '#'){
                cout << "NO"; exit(0);
            }

            vii gg = {
                {i, j},
                {i, j + 1},
                {i + 1, j},
                {i + 1, j + 1}
            };

            for(auto x : gg){
                for(auto y : gg){
                    if(!(x.f == y.f && x.s == y.s)){
                        if(x.f == y.f || x.s == y.s){
                            if(comp[x.f][x.s] != comp[y.f][y.s] && ar[x.f][x.s] == '#' && ar[y.f][y.s] == '#'){
                                cout << "NO"; exit(0);
                            }
                        }
                    }
                }
            }

        }
    }

    cout << "YES";
}

int main(){
    fast_io;

    for(int j = 0;j < 10;j++) cin >> ar[j];
    solve();
}