#include <bits/stdc++.h>
using namespace std;
const int precision = 13;
bool isX(int posI, int posJ, const vector<string>& board) {
  bool ret = false;
  if ((posI >= 0 and posI < 10) and (posJ >= 0 and posJ < 10) and
      board[posI][posJ] == 'X') {
    ret = true;
  }
  return ret;
}
bool checkBoard(const vector<string>& board, int n) {
  vector<int> dx = {1, 0, 1, 1};
  vector<int> dy = {0, 1, 1, -1};
  for (auto k = 0; k < 4; ++k) {
    for (auto i = 0; i < n; ++i) {
      for (auto j = 0; j < n; ++j) {
        int cnt = 0;
        for (auto l = 0; l < 5; ++l) {
          int x = i + dx[k] * l;
          int y = j + dy[k] * l;
          if (isX(x, y, board)) {
            cnt++;
          }
        }
        if (cnt >= 5) {
          return true;
        }
        cnt = 0;
      }
    }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(precision);
  cout.setf(ios_base::fixed);
  vector<string> game(10);
  for (auto i = 0; i < 10; ++i) {
    cin >> game[i];
  }
  for (auto k = 0; k < 10; ++k) {
    for (auto l = 0; l < 10; ++l) {
      if (game[k][l] == '.') {
        game[k][l] = 'X';
        if (checkBoard(game, 10) == true) {
          cout << "YES";
          return 0;
        }
        game[k][l] = '.';
      }
    }
  }
  cout << "NO"
       << "\n";
  return 0;
}
