#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <iomanip>
#include <fstream>
#include <stack>

#define int long long
#define endl '\n'
#define fi first
#define se second
#define p_b push_back

using namespace std;

const int inf = 1e9 + 7;

char a[15][15];
int mark[15][15];
int sz[15][15];
int score[6];
int n=10;

main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    for(int i=0;i<12;i++)
    {
        for(int j=0;j<12;j++)
        {
            a[i][j]='.';
        }
    }
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=n;j++)
        {
            char b;
            cin>>b;
            a[i][j]=b;
        }
    }
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=n;j++)
        {
            if(a[i][j]=='#'&&mark[i][j]==0)
            {
                if(a[i-1][j+1]=='#'||a[i-1][j-1]=='#'||a[i+1][j-1]=='#'||a[i+1][j+1]=='#')
                {
                    cout<<"NO";
                    return 0;
                }
                if(a[i+1][j]=='#'&&a[i][j+1]=='#')
                {
                    cout<<"NO";
                    return 0;
                }
                int sch=1;

                if(a[i+1][j]=='#')
                {
                    int x=i+1;
                    while(x<11&&a[x][j]=='#')
                    {
                        if(a[x][j-1]=='#'||a[x][j+1]=='#')
                        {
                            cout<<"NO";
                            return 0;
                        }
                        mark[x][j]=1;
                        sch++;
                        x++;
                    }
                    if(a[x][j+1]=='#'||a[x][j-1]=='#')
                    {
                        cout<<"NO";
                        return 0;
                    }
                }

                if(a[i][j+1]=='#')
                {
                    int x=j+1;
                    while(x<11&&a[i][x]=='#')
                    {
                        if(a[i-1][x]=='#'||a[i+1][x]=='#')
                        {
                            cout<<"NO";
                            return 0;
                        }
                        mark[i][x]=1;
                        sch++;
                        x++;
                    }
                    if(a[i+1][x]=='#'||a[i-1][x]=='#')
                    {
                        cout<<"NO";
                        return 0;
                    }
                }
                    if(sch>4)
                    {
                        cout<<"NO";
                        return 0;
                    }
                    score[sch]++;

            }
        }
    }
    for(int i=1;i<5;i++)
    {
        if(5-score[i]!=i)
        {
            cout<<"NO";
            return 0;
        }
    }
    cout<<"YES";
    return 0;
}
