#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll ;
typedef vector < int > vi ;
typedef pair < int , int > pi ;
 
// #define int long long
#define pb push_back
#define F first
#define S second
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define Bwka_GOVNO ios_base::sync_with_stdio(false); cin.tie(0);
 
const ll INF = 1e18;
const int N = 3e5 + 7;
const ll MOD = 1e9 + 7;
const int B = 320;
const int R = 1e9 + 7;
 
int main() {
    Bwka_GOVNO
     
    char mat[B][B];
     
     
    for (int i = 1; i <= 10; i++) {
        for (int j = 1; j <= 10; j++) {
            cin >> mat[i][j];
        }
    }
     
    for (int i = 1; i <= 9; i ++) {
        for (int j = 1; j <= 9; j++) {
            if (mat[i][j] == '#' && mat[i + 1][j + 1] == '#') {
                cout << "NO\n";
                return 0;
            }
        }
    }
     
    for (int i = 1; i <= 9; i++) {
        for (int j = 2; j <= 10; j++) {
            if (mat[i][j] == '#' && mat[i + 1][j - 1] == '#') {
                cout << "NO\n";
                return 0;
            }
        }
    }
     
     
    for (int i = 1; i <= 10; i++) {
        for (int j = 1; j <= 10; j++) {
            if (mat[i][j] == '#') {
                if (mat[i - 1][j] == '#' && mat[i][j + 1] == '#') {
                    cout << "NO\n";
                    return 0;
                }
                if (mat[i - 1][j] == '#' && mat[i][j - 1] == '#') {
                    cout << "NO\n";
                    return 0;
                }
                if (mat[i][j - 1] == '#' && mat[i - 1][j] == '#') {
                    cout << "NO\n";
                    return 0;
                } 
                if (mat[i][j - 1] == '#' && mat[i + 1][j] == '#') {
                    cout << "NO\n";
                    return 0;
                }
                if (mat[i - 1][j] == '#' && mat[i][j - 1] == '#') {
                    cout << "NO\n";
                    return 0;
                } 
                if (mat[i - 1][j] == '#' && mat[i][j + 1] == '#') {
                    cout << "NO\n";
                    return 0;
                }
                if (mat[i][j + 1] == '#' && mat[i - 1][j] == '#') {
                    cout << "NO\n";
                    return 0;
                }
                if (mat[i][j + 1] == '#' && mat[i + 1][j] == '#') {
                    cout << "NO\n";
                    return 0;
                }
            }
        }
    }
     
    cout << "YES\n";
}