#include <bits/stdc++.h>
using namespace std;
const int N=15;
char a[N][N];
bool used[N][N];
int main(){
	for(int i=0;i<12;i++){
		for(int j=0;j<12;j++){
			a[i][j] = '.';
		}
	}
	memset(used, false, sizeof(used));
	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(a[i][j] == '#'){
				if(a[i - 1][j - 1] == '#'){
					cout<<"NO"<<endl;
					return 0;
				}
				if(a[i + 1][j - 1] == '#'){
					cout<<"NO"<<endl;
					return 0;
				}
				if(a[i - 1][j + 1] == '#'){
					cout<<"NO"<<endl;
					return 0;
				}
				if(a[i + 1][j + 1] == '#'){
					cout<<"NO"<<endl;
					return 0;
				}
			}
		}
	}
	int one = 0, two = 0, three = 0, four = 0;
	for(int i=1;i<=10;i++){
		for(int j=1;j<=10;j++){
			if(a[i][j] == '#' && used[i][j] == false){
				used[i][j] = true;
				int temp = 1;
				if(a[i + 1][j] == '#'){
					int cur = i + 1;
					while(a[cur][j] == '#'){
						temp++;
						used[cur][j] = true;
						cur++;
					}
					if(temp == 2){
						two++;
					}
					else if(temp == 3) three++;
					else if(temp == 4) four++;
					else{
						cout<<"NO"<<endl;
						return 0;
					}
				}
				else if(a[i][j + 1] == '#'){
					int cur = j + 1;
					while(a[i][cur] == '#'){
						temp++;
						used[i][cur] = true;
						cur++;
					}
					if(temp == 2){
						two++;
					}
					else if(temp == 3) three++;
					else if(temp == 4) four++;
					else{
						cout<<"NO"<<endl;
						return 0;
					}
				}
				else{
					one++;
				}
			}
		}
	}
//	cout<<one<<" "<<two<<" "<<three<<" "<<four<<endl;
	if(one == 4 && two == 3 && three == 2 && four == 1){
		cout<<"YES"<<endl;
		return 0;
	}
	cout<<"NO"<<endl;
}
