#ifdef Local
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef long double ld;


template<typename T>
istream &operator>>(istream &in, vector<T> &a) {
    for (auto &i: a)in >> i;
    return in;
}

template<typename T>
ostream &operator<<(ostream &out, vector<T> &a) {
    for (auto &i: a)out << i << ' ';
    return out;
}

bool cmp(pair<ld, int> x, pair<ld, int> y) {
    return x.second < y.second;
}

ll fastpow(ll r, int st) {
    if (st <= 0) return 1;
    ll fp = fastpow(r, st / 2);
    if (st % 2 == 0) return fp * fp;
    return fp * fp * r;
}

vector<vector<bool>> g(10, vector<bool>(10, true));
vector<vector<bool>> used(10, vector<bool>(10, false));
enum direct {
    None = 0,
    Right = 1,
    Left = -1,
    Up = -2,
    Down = 2
};

struct pos {
    int r, c;

    pos(int x_ = 0, int y_ = 0) : r(x_), c(y_) {}

    pos(direct d) {
        pos p = pos(0, 0) + d;
        r = p.r;
        c = p.c;
    }

    pos operator*(int a) const {
        return {r * a, c * a};
    }

    [[nodiscard]] bool check() const {
        return r < 10 && r >= 0 && c < 10 && c >= 0;
    }

    pos operator+(const direct &d) const {
        if (abs(d) % 2 == 0)return {r + d / 2, c};
        else return {r, c + d};
    }

    pos operator+(const pos &other) const {
        return {r + other.r, c + other.c};
    }

    bool operator==(const pos &p) const {
        return r == p.r && c == p.c;
    }

    bool operator!=(const pos &p) const {
        return !((*this) == p);
    }
};

bool canMove(const pos &x) { return x.check() && g[x.r][x.c]; }

vector<pos> moves = {
        {1,  1},
        {1,  0},
        {1,  -1},
        {0,  1},
        {0,  -1},
        {-1, 1},
        {-1, 0},
        {-1, -1}
};


bool Normal(const pos &x, direct Ignore) {
    for (auto p: moves) {
        if (pos(Ignore) != p && pos(Ignore) != p * -1) {
            if (canMove(x + p)) return false;
        }
    }
    return true;
}

vector<direct> dir{Left, Up, Down, Right};

int dfs(pos v, direct d) {
    used[v.r][v.c] = true;
    if (d == None) {
        for (auto x: dir) {
            if (canMove(v + x)) {
                if (!Normal(v, x))return -1000;
                else return dfs(v + x, x) + 1;
            }
        }
        return 1;
    }
    if (!Normal(v, d))return -1000;
    if (canMove(v + d))return dfs(v + d, d) + 1;
    else return 1;
}

void solve() {
    for (int r = 0; r < 10; r++) {
        for (int cl = 0; cl < 10; cl++) {
            char c;
            cin >> c;
            g[r][cl] = c == '#';
            used[r][cl] = c != '#';
        }
    }
    map<int, int> mp;
    for (int r = 0; r < 10; r++) {
        for (int cl = 0; cl < 10; cl++) {
            if (!used[r][cl]) {
                int x = dfs(pos(r, cl), None);
                if (x < 0 || x > 4) {
                    cout << "NO" << '\n';
                    return;
                }
                mp[x]++;
            }
        }
    }
    if (mp[1] != 4 || mp[2] != 3 || mp[3] != 2 || mp[4] != 1)cout << "NO\n";
    else cout << "YES\n";
}

signed main() {
#ifdef Local
    freopen("in.in","r",stdin);
    freopen("out.out","w",stdout);
#else
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
#endif
    int t = 1;
    cout.precision(20);
    if (t == -1)cin >> t;
    for (int i = 0; i < t; i++)solve();
}

