import java.util.Scanner;

public class main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String a[] = new String[10];
		int b = 0;
		int x = 0;
		int y = 0;
		int t1 = 0;
		int t2 = 0;
		int t3 = 0;
		int t4 = 0;
		for(int i = 0;i<10;i++) {
			a[i]=sc.nextLine();
		}
		for(int i = 0;i<10;i++) {
			for(int ii = 0;ii<10;ii++) {
				if(a[i].charAt(ii)=='#') {
					b++;
					///
					try {
						if(a[i-1].charAt(ii-1)=='#') {
							System.out.println("NO");
							System.exit(0);
						}
					}
					catch(Exception e) {}
					try {
						if(a[i-1].charAt(ii+1)=='#') {
							System.out.println("NO");
							System.exit(0);
						}
					}
					catch(Exception e) {}
					try {
						if(a[i+1].charAt(ii-1)=='#') {
							System.out.println("NO");
							System.exit(0);
						}
					}
					catch(Exception e) {}
					try {
						if(a[i+1].charAt(ii+1)=='#') {
							System.out.println("NO");
							System.exit(0);
						}
					}
					catch(Exception e) {}
					///
					try {
						if(a[i].charAt(ii-1)=='#')x++;
					}
					catch(Exception e) {}
					try {
						if(a[i].charAt(ii+1)=='#')x++;
					}
					catch(Exception e) {}
					try {
						if(a[i-1].charAt(ii)=='#')y++;
					}
					catch(Exception e) {}
					try {
						if(a[i+1].charAt(ii)=='#')y++;
					}
					catch(Exception e) {}
					if(x>0&&y>0||y>0&&x>0) {
						System.out.println("NO");
						System.exit(0);
					}
					if(x==0&&y==0)t1++;
					
						x=0;
						try {
							if(a[i].charAt(ii+1)=='#')x++;
						}
						catch(Exception e) {}
						try {
							if(a[i].charAt(ii+2)=='#' && a[i].charAt(ii+1)=='#')x++;
						}
						catch(Exception e) {}
						try {
							if(a[i].charAt(ii+3)=='#'&& a[i].charAt(ii+2)=='#' && a[i].charAt(ii+1)=='#')x++;
						}
						catch(Exception e) {}
						try {
							if(a[i].charAt(ii-1)=='#')x++;
						}
						catch(Exception e) {}
						try {
							if(a[i].charAt(ii-2)=='#'&& a[i].charAt(ii-1)=='#')x++;
						}
						catch(Exception e) {}
						try {
							if(a[i].charAt(ii-3)=='#'&& a[i].charAt(ii-2)=='#'&& a[i].charAt(ii-1)=='#')x++;
						}
						catch(Exception e) {}
						if(x==1)t2++;
						if(x==2)t3++;
						if(x==3)t4++;
					
						y=0;
						try {
							if(a[i+1].charAt(ii)=='#')y++;
						}
						catch(Exception e) {}
						try {
							if(a[i+2].charAt(ii)=='#'&&a[i+1].charAt(ii)=='#')y++;
						}
						catch(Exception e) {}
						try {
							if(a[i+3].charAt(ii)=='#'&&a[i+2].charAt(ii)=='#'&&a[i+1].charAt(ii)=='#')y++;
						}
						catch(Exception e) {}
						try {
							if(a[i-1].charAt(ii)=='#')y++;
						}
						catch(Exception e) {}
						try {
							if(a[i-2].charAt(ii)=='#'&&a[i-1].charAt(ii)=='#')y++;
						}
						catch(Exception e) {}
						try {
							if(a[i-3].charAt(ii)=='#'&&a[i-2].charAt(ii)=='#'&&a[i-1].charAt(ii)=='#')y++;
						}
						catch(Exception e) {}
						if(y==1)t2++;
						if(y==2)t3++;
						if(y==3)t4++;
					x=0;
					y=0;
				}
			}
		}
		t2/=2;
		t3/=3;
		t4/=4;
		if(b!=20) {
			System.out.println("NO");
			System.exit(0);
		}
		if(t1!=4) {
			System.out.println("NO");
			System.exit(0);
		}
		if(t2!=3) {
			System.out.println("NO");
			System.exit(0);
		}
		if(t3!=2) {
			System.out.println("NO");
			System.exit(0);
		}
		if(t4!=1) {
			System.out.println("NO");
			System.exit(0);
		}
		System.out.println("YES");
		

	}

}
