#include <bits/stdc++.h>

using namespace std;

#define int long long
#define all(x) x.begin(), x.end()
#define pb push_back
#define size(x) (int)x.size()
#define ll long long
#define ff first
#define ss second
#define endl '\n'
#define fr first
#define sc second
#define ld long double

template <typename _T>
bool chmin(_T &a, const _T &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <typename _T>
bool chmax(_T &a, const _T &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

const int mod = 998244353;
const int MOD = 1e9 + 7;
const int inf = 1e9 + 7;
const int INF = 1e18 + 7;
const double eps = 1e-6;
const double EPS = 1e-9;

void solve() {
  char s[10][10];
  for (int i = 0; i < 10; ++i) {
    for (int j = 0; j < 10; ++j) {
      cin >> s[i][j];
      if (s[i][j] == '#') {
        s[i][j] = '*';
      }
    }
  }
  auto check = [&](int i, int j) {
    return i >= 0 && i < 10 && j >= 0 && j < 10;
  };
  vector<vector<bool>> vis(10, vector<bool> (10, false));
  vector<int> cnt(4, 0);
  for (int i = 0; i < 10; ++i) {
    for (int j = 0; j < 10; ++j) {
      if (s[i][j] == '*' && !vis[i][j]) {
        vis[i][j] = true;
        if (check(i - 1, j - 1) && s[i - 1][j - 1] == '*') {
          cout << "NO"; return;
        }
        if (check(i - 1, j + 1) && s[i - 1][j + 1] == '*') {
          cout << "NO"; return;
        }
        if (check(i + 1, j - 1) && s[i + 1][j - 1] == '*') {
          cout << "NO"; return;
        }
        if (check(i + 1, j + 1) && s[i + 1][j + 1] == '*') {
          cout << "NO"; return;
        }
        bool v = false, h = false;
        int x = i, y = j, d = 0;
        while (check(x, y - 1) && s[x][y - 1] == '*') {
          y--;
          vis[x][y] = true;
          v = true;
          d++;
        }
        x = i, y = j;
        while (check(x, y + 1) && s[x][y + 1] == '*') {
          y++;
          vis[x][y] = true;
          v = true;
          d++;
        }
        x = i, y = j;
        while (check(x - 1, y) && s[x - 1][y] == '*') {
          x--;
          vis[x][y] = true;
          h = true;
          d++;
        }
        x = i, y = j;
        while (check(x + 1, y) && s[x + 1][y] == '*') {
          x++;
          vis[x][y] = true;
          h = true;
          d++;
        }
        if (v && h) {
          cout << "NO"; return;
        }
        cnt[d]++;
      }
    }
  }
  if (cnt[0] == 4 && cnt[1] == 3 && cnt[2] == 2 && cnt[3] == 1) {
    cout << "YES";
  } else {
    cout << "NO";
  }
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int tt = 1;
  //cin >> tt;
  while(tt--) {
    solve();
  }
}
