#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
char a[110][110];
vector<pair<int, int> > ind;
char straight(int i, int j) {
  if (j > 6) return false;
  bool checker = false;
  for (int k = j; k < j + 5; k++) {
    if (a[i][k] == 'O') {
      return false;
    }
    if (a[i][k] == '.' && checker) return false;
    if (a[i][k] == '.') checker = true;
  }
  return true;
}
char up(int i, int j) {
  bool checker = false;
  if (i < 5 || j > 6) return false;
  for (int k = j; k < j + 5; k++) {
    if (a[i][k] == 'O') {
      return false;
    }
    if (a[i][k] == '.' && checker) return false;
    if (a[i][k] == '.') checker = true;
    --i;
  }
  return true;
}
char leftdown(int i, int j) {
  bool checker = false;
  if (i > 6 || j > 6) return false;
  for (int k = j; k < j + 5; k++) {
    if (a[i][k] == 'O') {
      return false;
    }
    if (a[i][k] == '.' && checker) return false;
    if (a[i][k] == '.') checker = true;
    ++i;
  }
  return true;
}
char down(int i, int j) {
  if (i > 6) return false;
  bool checker = false;
  for (int k = i; k < i + 5; k++) {
    if (a[k][j] == 'O') {
      return false;
    }
    if (a[k][j] == '.' && checker) return false;
    if (a[k][j] == '.') checker = true;
  }
  return true;
}
int main() {
  for (int i = 1; i <= 10; i++) {
    for (int j = 1; j <= 10; j++) {
      cin >> a[i][j];
      if (a[i][j] != 'O') ind.push_back(make_pair(i, j));
    }
  }
  for (int i = 0; i < ind.size(); i++) {
    if (straight(ind[i].first, ind[i].second)) {
      cout << "YES\n";
      return 0;
    }
    if (down(ind[i].first, ind[i].second)) {
      cout << "YES\n";
      return 0;
    }
    if (leftdown(ind[i].first, ind[i].second)) {
      cout << "YES\n";
      return 0;
    }
    if (up(ind[i].first, ind[i].second)) {
      cout << "YES\n";
      return 0;
    }
  }
  cout << "NO\n";
}
