#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define int long long
#define ll long long
#define f first
#define s second
#define pb push_back
#define sz(x) (int) x.size()
#define all(x) begin(x), end(x)

using namespace std;

const int N = 2e5 + 1, inf = LLONG_MAX / 2ll ;
    int n = 10,m = 10;

bool was[11][11];
char a[10 + 2][10 + 2];

int bfs(int x,int y) {
    if(x == 0 || y == 0 || x > n || y > m || a[x][y] == '.' || was[x][y]) return 0;
    was[x][y] = true;
    return 1 + bfs(x + 1,y) + bfs(x - 1,y) + bfs(x,y - 1) + bfs(x,y + 1); 
}
void solve() {
    int kol[1000] = {};
    for(int i = 1;i <= n;i++) {
        for(int j = 1;j <= m;j++) {
            cin >> a[i][j];
        }
    }
    bool check = true;
    for(int i = 1;i <= n;i++) {
        for(int j = 1;j <= m;j++) {
            if(a[i][j] == '#'&&(a[i + 1][j + 1] == '#' || a[i + 1][j - 1] == '#' || a[i - 1][j - 1] == '#' || a[i - 1][j + 1] == '#')) check = false;
            if(was[i][j] == false&&a[i][j] != '.') {
                kol[bfs(i,j)]++;
            }
        }
    }
    for(int i = 5;i < 1000;i++) {
        if(kol[i] > 0) check = false;
    }
    if(check&&kol[1] == 4&&kol[2] == 3&&kol[3] == 2&&kol[4] == 1) cout << "YES" << endl;
    else cout << "NO" << endl;
}

signed main() {
    ios_base::sync_with_stdio(NULL);
    cin.tie(0);cout.tie(0);
    int T = 1 ;
    while (T--) {
        solve ( ) ;
    }
    return 0 ;
}