#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <set>
#include <map>
#include <fstream>
#include <algorithm>
#include <stack>
#include <deque>
#include <iomanip>
#include <queue>
#include <sstream>


using namespace std;


#define int long long
#define ull unsigned long long

int mod = 998244353;


int fact(int n){
    int f = 1;
    for(int i = 1; i < n; i++){
        f = (f * (i + 1)) % mod;
    }
    return f;
}

void HeapSort(vector<int>& values) {
    make_heap(values.begin(), values.end());
    for (auto i = values.end(); i != values.begin(); --i) {
        pop_heap(values.begin(), i);
    }
}

int bp(int a, int m){
    if(m == 1)return a;
    if(m % 2) return (a *bp(a, m - 1)) % mod;
    int t = bp(a, m / 2);
    return (t * t) % mod;
}

vector<int> er(int n, vector<int> &g){
    vector<int> val;
    int v = n;
    while(v != 1){
        if(val.empty() || val[val.size() - 1] != g[v]){
            val.push_back(g[v]);
        }
        v = v / g[v];
    }
    return val;
}


struct edg{
    int v, u, w;
};


signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    vector<vector<char>> a(11, vector<char> (11, '.'));
    vector<vector<int>> dp(11, vector<int> (11, 0));
    int cnt = 0;
    for(int i = 1; i < 11; i++){
        for(int j = 1; j < 11; j++){
            cin >> a[i][j];
            if(a[i][j] == '#'){
                cnt++;
                if(a[i - 1][j - 1] == '#' || a[i - 1][j + 1] == '#'){
                    cout << "NO";
                    return 0;
                }
            }
        }
    }
    if(cnt != 20){
        cout << "NO";
        return 0;
    }
    map<int, int> b;
    int x = 0, y = 0;
    for(int i = 0; i < 11; i++){
        for(int j = 0; j < 11; j++){
            if(a[i][j] == '#'){
                x++;
            }
            else{
                b[x]++;
                x = 0;
            }
        }
    }
    for(int i = 0; i < 11; i++){
        for(int j = 0; j < 11; j++){
            if(a[j][i] == '#'){
                y++;
            }
            else{
                b[y]++;
                y = 0;
            }
        }
    }
    int xui = 0;
    for(int i = 1; i < 10; i++){
        for(int j = 1; j < 10; j++){
            if(a[i][j] == '#' && a[i - 1][j] != '#' && a[i + 1][j] != '#' && a[i][j + 1] != '#' && a[i][j - 1] != '#'){
                xui++;
            }
        }
    }
    if(b[2] == 3 && b[3] == 2 && b[4] == 1 && xui == 4){
        cout << "YES";
    }
    else{
        cout << "NO";
    }
    return 0;
}
