#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <fstream>
#include <unordered_map>
using namespace std;

typedef long long ll;
typedef long double ld;

#define all(x) x.begin(),x.end()
#define pb push_back
#define ent "\n"

const int maxn = (int)2e5 + 13;
const ll inf = (long long)1e18 + 20;
const int mod = (int)1e9 + 7;
char a[15][15];
bool used[15][15];
int cnt[10];
void dfs(int i,int j,int amo){
    used[i][j] = 1;
    amo++;
    bool ok = 0;
    if(i > 1 && a[i-1][j] == '#' && used[i - 1][j] == 0){
        ok = 1;
        dfs(i-1,j,amo);
    }
    if(j > 1 && a[i][j - 1] == '#' && used[i][j -1] == 0){
        ok = 1;
        dfs(i,j - 1,amo);
    }
    if(i < 10 && a[i + 1][j] == '#' &&  used[i + 1][j] == 0){
        ok = 1;
        dfs(i + 1,j,amo);
    }
    if(j < 10 && a[i][j + 1] == '#' && used[i][j + 1] == 0){
        ok = 1;
        dfs(i,j+1,amo);
    }
    if(!ok)cnt[amo]++;
}
void solve(){
    for(int i = 1;i <= 10;i++){
        for(int j = 1;j <= 10;j++){
            cin >> a[i][j];
        }
    }
    for(int i = 1;i <= 10;i++){
        for(int j = 1;j <= 10;j++){
            if(used[i][j] == 0 && a[i][j] == '#'){
                dfs(i,j,0);
            }
        }
    }
    if(cnt[1] != 4 || cnt[2] != 3 || cnt[3] != 2 || cnt[4] != 1){
        cout << "NO";
        return;
    }
    for(int i = 1;i <= 10;i++){
        for(int j = 1;j <= 10;j++){
            if(i > 1 && j > 1 && a[i - 1][j - 1] == '#' && a[i][j] == '#'){
                cout << "NO";
                return;
            }
            if(j <  10 && i > 1 && a[i - 1][j + 1] == '#' && a[i][j] == '#'){
                cout << "NO";
                return;
            }
        }
    }
    cout << "YES";
}

int main(){
 ios_base::sync_with_stdio(0);
 cin.tie(0);
 int t = 1;
 //cin >> t;
 while(t --){
  solve();
 }
 return 0;
}
