#include<bits/stdc++.h>
	#define en "\n"
	#define s second
	#define f first
	#define int long long
	#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)
	#define vi vector<int>
	#define vii vector<pair<int,int> >
	#define rall(x) x.rbegin(), x.rend()
	#define pb push_back
	#define loop(a) for(int i = 0; i < a; i++)
	#define loopv(i,a) for (int i = 0; i < a; i++)
	#define all(x) (x).begin(), (x).end()
	#define prDouble(x) cout << fixed << setprecision(10) << x
	#define goog(tno) cout << "Case #" << tno <<": "
	using namespace std;
	 
	int gcd (int a, int b) {
	    while (b) {
	        a %= b;
	        swap (a, b);
	    }
	    return a;
	}
	int lcm (int a, int b) {
	    return a / gcd (a, b) * b;
	}
	
	signed main()
	{
	    fast_io;
	    vector <vector <char>> a(12, vector <char>(12, '.'));
	    int n = 10;
	    for(int i=1; i<=n; i++){
	    	for(int j=1; j<=n; j++){
	    		cin>>a[i][j];
	    	}
	    }
	    vector <int> res(5);
	    res[4] = 1;
	    res[3] = 2;
	    res[2] = 3;
	    res[1] = 4;
	    vector <vector <int>> u(12, vector <int>(12, 0));
	    bool bo = 0;
	    for(int i1=1; i1<=n; i1++){
	    	for(int j1=1; j1<=n; j1++){
	    		if(a[i1][j1] == '#' and u[i1][j1]==0){
	    			int i = i1, j = j1, s = 1;
	    			while(true){
	    				int ki, kj;
		    			int k = 0;
		    			u[i][j] = 1;
		    			if (a[i + 1][j] == '#' and u[i + 1][j] == 0) {
						    k++;
						    u[i + 1][j] = 1;
						    ki = i + 1, kj = j;
						}
						
						if (a[i - 1][j] == '#' and u[i - 1][j] == 0) {
						    k++;
						    u[i - 1][j] = 1;
						    ki = i - 1, kj = j;
						}
						
						if (a[i][j + 1] == '#' and u[i][j + 1] == 0) {
						    k++;
						    u[i][j + 1] = 1;
						    ki = i, kj = j + 1;
						}
						
						if (a[i][j - 1] == '#' and u[i][j - 1] == 0) {
						    k++;
						    u[i][j - 1] = 1;
						    ki = i, kj = j - 1;
						}
						
						if (a[i + 1][j + 1] == '#' and u[i + 1][j + 1] == 0) {
						    k++;
						    u[i + 1][j + 1] = 1;
						    ki = i + 1, kj = j + 1;
						}
						
						if (a[i + 1][j - 1] == '#' and u[i + 1][j - 1] == 0) {
						    k++;
						    u[i + 1][j - 1] = 1;
						    ki = i + 1, kj = j - 1;
						}
						
						if (a[i - 1][j + 1] == '#' and u[i - 1][j + 1] == 0) {
						    k++;
						    u[i - 1][j + 1] = 1;
						    ki = i - 1, kj = j + 1;
						}
						
						if (a[i - 1][j - 1] == '#' and u[i - 1][j - 1] == 0) {
						    k++;
						    u[i - 1][j - 1] = 1;
						    ki = i - 1, kj = j - 1;
						}
						
		    			if(k==0){
		    				res[s]--;
		    				break;
		    			}
		    			if(k>1){
		    				bo = 1;
		    				break;
		    			}
		    			if(k==1){
		    				s++;
		    				i = ki, j = kj;
		    			}
	    			}
	    			if(bo){
	    				break;
	    			}
	    		}
	    		if(bo){
	    			break;
	    		}
	    		u[i1][j1] = 1;
	    	}
	    	if(bo){
	    		break;
	    	}
	    }
	    if(res[1] == 0 and res[2] == 0 and res[3] == 0 and res[4] == 0 and !bo){
	    	cout<<"YES";
	    }
	    else{
	    	cout<<"NO";
	    }
	    
	    
	    
	    
	}
