#include <bits/stdc++.h>
using namespace std;
void solve();
signed main() {
  cout.precision(10);
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t = 1;
  long long tt = t;
  while (t--) {
    solve();
  }
  return 0;
}
char arr[10][10];
bool val(long long ii, long long jj) {
  return ii >= 0 and ii < 10 and jj >= 0 and jj < 10;
}
bool check() {
  for (long long i = 0; i < 10; ++i) {
    for (long long j = 0; j < 10; ++j) {
      long long dx[] = {1, 0, 1, 1};
      long long dy[] = {0, 1, 1, -1};
      for (long long k = 0; k < 4; ++k) {
        long long ii = i;
        long long jj = j;
        bool ok = true;
        for (long long step = 0; step < 5; ++step) {
          if (!val(ii, jj)) {
            ok = false;
            break;
          }
          if (arr[ii][jj] != 'X') {
            ok = false;
            break;
          }
          ii += dx[k];
          jj += dy[k];
        }
        if (ok) return true;
      }
    }
  }
  return false;
}
void solve() {
  for (long long i = 0; i < 10; ++i)
    for (long long j = 0; j < 10; ++j) cin >> arr[i][j];
  bool found = false;
  if (check()) found = true;
  for (long long i = 0; i < 10; ++i) {
    for (long long j = 0; j < 10; ++j) {
      char org = arr[i][j];
      if (arr[i][j] == 'O') continue;
      arr[i][j] = 'X';
      if (check()) found = true;
      arr[i][j] = org;
      if (found) {
        cout << "YES\n";
        return;
      }
    }
  }
  cout << "NO";
}
