#include <bits/stdc++.h>
using namespace std;
map<int, int> count_t;
vector<vector<bool> > t (10, vector<bool> (10, false));
vector<vector<bool> > p (10, vector<bool> (10, false));

int req (int i, int j, int count=1) {
    if (p[i][j] || !t[i][j]) return 2;
    p[i][j] = true;
    int near = 0;
    if (i < 10 && j+1 < 10 && t[i][j+1]) {
        if (p[i][j+1])
            return 0;
        else {
            int res = req (i,j+1,count+1);
            if (res == 1) {
                near ++;
            } else if (res == 0) {
                return 0;
            }
        }
    }

    if (i+1 < 10 && j < 10 && t[i+1][j] && !p[i+1][j]) {
        if (p[i+1][j])
            return 0;
        else {
            int res = req (i+1,j,count+1);
            if (res == 1) {
                near ++;
            } else if (res == 0) {
                return 0;
            }
        }
    }

    if (i+1 < 10 && j+1 < 10 && t[i+1][j+1]) {
        return 0;
    }
    if (near > 1) return 0;
    else if (near == 0)
        count_t[count]++;
    return 1;
}

int main(){

    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            char a;
            cin >> a;
            if (a == '#')
                t[i][j] = true;
        }
    }
    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            if (!req(i, j)) {
                cout << "No";
                return 0;
            }
        }
    }
    if (count_t.size() != 4) cout << "No";
    else if (count_t[1] != 4 || count_t[2] != 3 || count_t[3] != 2 || count_t[4] != 1) cout << "No";
    else cout << "Yes";
    return 0;
}
