#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <string>
#include <iomanip>
#include <cmath>
#include <set>
#include <map>
#include <iterator>
using namespace std;

#define ll long long


#define F first
#define S second

#define en end()
#define bg begin()

#define rev reverse
#define mp make_pair
#define pb push_back

int main(){
    char c[11][11];
    for(int i = 0; i < 10; i++){
        for(int j = 0; j < 10; j++){
            cin >> c[i][j];
        }
    }
    for(int i = 0; i < 10; i++){
        for(int j = 0; j < 10; j++){
            if(c[i][j] == '#'){
                if(c[i+1][j+1] == '#' || c[i-1][j+1] == '#' || c[i+1][j-1] == '#' || c[i-1][j-1] == '#'){
                    cout << "NO";
                    return 0;
                }
            }
        }
    }
    cout << "YES";
}
