#include <string>
#include <iostream>
#include <vector>
#include <set>
#include <iomanip>
#include <stack>
#include <cmath>
#include <map>
#include <tuple>
#include <numeric>
#include <queue>
#include <algorithm>
#include <bitset>
#include<iterator>
#include <fstream>
#include <random>
#include <unordered_map>
#include <ctime>
#include <sstream>

using namespace std;

#define INF 1e17
#define MOD %=((ll)1000000007);
#define ll long long
#define si short int
#define ull unsigned long long
#define str string
#define vc vector //by jgjgjjg :)
#define db double 
#define fco {ios_base::sync_with_stdio(0);std::cout.tie(0); std::cin.tie(0); }
#define scan(t) {for (ll i = 0; i<(t.size()); i++) std::cin >> t[i];}
#define cf {fflush(stdout);}
#define SUM(a,sum) ll sum = 0; for (auto _p:a) sum += _p;
#define MAX(a, mx, pos) ll mx = -(1e18+1); ll pos = 0;FOR(i,a.size()) if (a[i] > mx) {pos = i;mx=a[i];};
#define FL(f) bool f = false;
#define NOO cout << -1 << endl;return 0;
#define its(a) a.begin(),a.end()
#define itsr(a) a.rbegin(),a.rend()
#define pb push_back
#define mset multiset
#define pos2 pair<ll,ll>
#define sz(a) (int)a.size()
#define fi first
#define se second
#define mnmx(a,b) {ll __c = a; a = min(a,b), b = max(b,__c);}
#define np nullptr
#define tpl tuple<ll, ll,ll>
#define M 1000000007
vc<vc<char>> mat;
map<ll, ll> has;


ll rec(ll n) {
    if (has.count(n) == 1) return has[n];
    if (n == 1) return 1;
    ll ans = n;
    ans += rec(n / 2);
    ans += rec(n-n/2);
    has[n] = ans;
    return ans;
}


void solve() {
    //ll w, h; cin >> w >> h; cout << rec(w*h);
    mat.assign(40, vc<char>(40, '.'));
    for (int i = 5; i < 15; i++) {
        for (int j = 5; j < 15; j++) {
            cin >> mat[i][j];
        }
    }
    vc<vc<bool>> used(40, vc<bool>(40 ,0));
    map<ll, ll> ans;
    for (int i = 5; i < 15; i++) {
        for (int j = 5; j < 15; j++) {
            if (mat[i][j] == '.' or used[i][j]) continue;
            ll cntvert = 0;
            int d = 0;
            while (mat[i + d + 1][j] == '#') {
                used[i + d + 1][j] = 1;
                d++;
            }
            bool v = 1;
            for (int w = 0; w <= d + 1; w++) {
                if (mat[i + w][j - 1] == '#') v = 0;
                if (mat[i + w][j + 1] == '#') v = 0;
            }
            if (v == 0 or d > 3) cntvert = -1;
            else cntvert = d+1;

            ll cntg = 0;
            d = 0;
            while (mat[i][j + d + 1] == '#') {
                used[i][j + d + 1] = 1;
                d++;
            }
            v = 1;
            for (int w = 0; w <= d + 1; w++) {
                if (mat[i-1][j+w] == '#') v = 0;
                if (mat[i + 1][j+w] == '#') v = 0;
            }
            if (v == 0 or d > 3) cntg = -1;
            else cntg = d + 1;
            if (cntvert == -1 and cntg == -1) {
                cout << "NO";
                return;
            }
            if (cntvert == -1) ans[cntg]++;
            if (cntg == -1) ans[cntvert]++;
            if (cntg == 1 and cntvert == 1) ans[1]++;
            //ans[cntg]++;
            //ans[cntvert]++;
        }
    }
    if (ans.size() == 4 and ans[1] == 4 and ans[2] == 3 and ans[3] == 2 and ans[4] == 1) {
        cout << "YES";
    }
    else {
        cout << "NO";
    }
}
/*
#.#.#.....
.......##.
.#..#.....
.#........
.#..##....
..........
####...#..
.......#..
.......#..
##........

##..#.....
.......##.
.#..#....#
.#........
.#........
..........
####...#..
.......#..
.......#..
##.......#

*/
int main() {
    fco;
    //ll _t; cin >> _t;
    //while (_t--)
        solve();
}