#include <bits/stdc++.h>
#define f first
#define s second
#define ll long long
#define pb push_back
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define mk make_pair
#pragma comment(linker, "/stack:2000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")

using namespace std;
int counter[5];
char tab[11][11];
int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, 1, 0, -1};
pair<int, int> dl[4] = {{-1, -1}, {-1, 1}, {1, -1}, {1, 1}};

bool check(int x, int y){
    return (x > 0 && x <= 10 && y > 0 && y <= 10 && tab[x][y] != '.');
}


int main() {
    IOS;

    for (int i = 1; i <= 10; i++){
        for (int j = 1; j <= 10; j++)
            cin >> tab[i][j];
    }
    for (int i = 1; i <= 10; i++){
        for (int j = 1; j <= 10; j++){
        //cout << "COR " << i << ' ' << j << '\n';
            if (tab[i][j] == '.'){
                    continue;
            }
            queue <pair<int, int>> q;
            q.push({i, j});
            int cnt = 1;
            while (!q.empty()){
                int vx = q.front().f;
                int vy = q.front().s;
                //cout << "V " << vx << ' ' << vy << '\n';
                q.pop();
                tab[vx][vy] = '.';
                for (int k = 0; k < 4; k++){
                    int tox = vx + dl[k].f;
                    int toy = vy + dl[k].s;
                    if (tab[tox][toy] == '#'){
                        //cout << "K " << dl[k].f << ' ' << dl[k].s << '\n';
                        //cout << "!!! " << tox << ' ' << toy << ' ' << vx << ' ' << vy << '\n';
                        cout << "NO";
                        return 0;
                    }
                }
                for (int k = 0; k < 4; k++){
                    int tox = vx + dx[k];
                    int toy = vy + dy[k];
                    //cout << "TO " << tox << ' ' << toy << '\n';
                    if (check(tox, toy)){
                        q.push({tox,toy});
                        cnt++;

                    }
                }

            }
            counter[cnt] += 1;
            for (int k = 1; k <= 4; k++){
                //cout << "CNT " << counter[k] << ' ';
            }
            //cout << '\n';
        }
    }
    if (counter[1] != 4){
        //cout << "!!! 1" << ' ' << counter[1] << '\n';
        cout << "NO";
        return 0;
    } else if (counter[2] != 3){
        //cout << "!!! 2" << '\n';
        cout << "NO";
        return 0;
    } else if(counter[3] != 2){
        //cout << "!!! 3" << '\n';
        cout << "NO";
        return 0;
    } else if (counter[4] != 1){
        //cout << "!!! 4" << '\n';
        cout << "NO";
        return 0;
    }else
    cout << "YES";
}
