#include <iostream>
#include <unordered_map>
#include <vector>

using namespace std;

int main() {
    int counter = 0;
    int neighbour = 0;
    vector<vector<char>> matrix(12,vector<char>(12));
    for(int i = 0; i < 12 ; i++){
        matrix[i][0] = '.';
        matrix[i][11] = '.';
    }
    for(int i = 1; i < 11; i++){
        for(int j = 1; j < 11; j++){
            cin >> matrix[i][j];
            if(matrix[i][j] == '#')
            counter++;
        }
    }
    matrix[0] = {'.','.','.','.','.','.','.','.','.','.','.','.'};
    matrix[11] = {'.','.','.','.','.','.','.','.','.','.','.','.'};
   bool ispossible = true;
    for(int i = 1; i < 11; i++){
        if(!ispossible)
        break;
        for(int j = 1; j < 11; j++){
            if(matrix[i][j] == '.')
            continue;
            else{
                if(matrix[i-1][j+1] == '#'){
                    ispossible = false;
                    break;
                }
                else if( matrix[i+1][j-1] == '#'){
                    ispossible = false;
                    break;
                }
                else if(matrix[i+1][j+1] == '#' ){
                    ispossible = false;
                    break;
                }
                else if(matrix[i-1][j-1] == '#'){
                    ispossible = false;
                    break;
                }
                if(matrix[i][j-1] == '#'){
                    neighbour++;
                }
                if(matrix[i + 1][j] == '#'){
                    neighbour++;
                }
                if(matrix[i][j + 1] == '#'){
                    neighbour++;}
                if(matrix[i-1][j] == '#'){
                    neighbour++;                }
            }
        }
    }
    if(ispossible && neighbour == 20 && counter == 20)
    cout << "YES\n";
    else
    cout << "NO\n";
    /*for(vector<char> vc : matrix){
    for(char c : vc){
        cout << c;
    }
    cout << "\n";
   }*/
   /*cout << counter << "\n";
   cout << neighbour << "\n";
   cout << ispossible << "\n";*/
    return 0;
}