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

#define int long long

#define f first
#define s second

using namespace std;
const int inf = 1e18 + 3;

main()
{
    const int n = 10;
    char a[n][n];

    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
            cin >> a[i][j];
    }

    int ch[10] = {0};
    int ans=0;
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
        {

            if(a[i][j] == '#')
            {
                int kol = 1;
                ans++;
                if(i < n - 1 && a[i + 1][j] == '#')
                {
                    int k = i+1;

                    while(k < n && a[k][j] == '#')
                    {
                        a[k][j]='.';
                        ans++;
                         if(a[k+1][j+1]=='#' || a[k+1][j-1]=='#')
                          {
                        cout << "NO";
                        return 0;
                    } kol++;
                         k++;
                    }

                }

                if(j < n - 1 && a[i][j + 1] == '#')
                {
                    if(kol != 1)
                    {
                        cout << "NO";
                        return 0;
                    }

                    int k = j+1;

                    while(k < n && a[i][k] == '#')
                    {
                        a[i][k] = '.';
                        ans++;
                         if(a[i+1][k+1]=='#' || a[i+1][k-1]=='#')
                          {
                        cout << "NO";
                        return 0;
                    }k++;
                        kol++;
                    }

                }

                if(j < n - 1 && i < n - 1 && a[i + 1][j + 1] == '#' )
                {
                    cout << "NO";
                    return 0;
                }

                ch[kol]++;
            }
        }
    }
   // cout<<ch[1]<<" "<<ch[2]<<" "<<ch[3]<<" "<<ch[4]<<endl;
    if(ch[1] == 4 && ch[2] == 3 && ch[3] == 2 && ch[4] == 1 && ans==20)
        cout << "YES";

    else
        cout << "NO";

    return 0;
}
