#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MX = 4e2 + 7;
char mp[20][20];
int n;
bool judge(int x, int y) {
  int cnt = 1;
  for (int i = y + 1; i <= n; ++i) {
    if (mp[x][i] == 'X')
      cnt++;
    else
      break;
  }
  for (int i = y - 1; i >= 1; --i) {
    if (mp[x][i] == 'X')
      cnt++;
    else
      break;
  }
  if (cnt >= 5) return true;
  cnt = 1;
  for (int i = x + 1; i <= n; ++i) {
    if (mp[i][y] == 'X')
      cnt++;
    else
      break;
  }
  for (int i = x - 1; i >= 1; --i) {
    if (mp[i][y] == 'X')
      cnt++;
    else
      break;
  }
  if (cnt >= 5) return true;
  cnt = 1;
  for (int i = 1;; i++) {
    if (x - i < 1 || y + i > n) break;
    if (mp[x - i][y + i] == 'X')
      cnt++;
    else
      break;
  }
  for (int i = 1;; i++) {
    if (x + i > n || y - i < 1) break;
    if (mp[x + i][y - i] == 'X')
      cnt++;
    else
      break;
  }
  if (cnt >= 5) return true;
  cnt = 1;
  for (int i = 1;; ++i) {
    if (x - i < 1 || y - i < 1) break;
    if (mp[x - i][y - i] == 'X')
      cnt++;
    else
      break;
  }
  for (int i = 1;; ++i) {
    if (x + i > n || y + i > n) break;
    if (mp[x + i][y + i] == 'X')
      cnt++;
    else
      break;
  }
  if (cnt >= 5) return true;
  return false;
}
int main() {
  n = 10;
  for (int i = 1; i <= n; ++i) {
    cin >> (mp[i] + 1);
  }
  bool flag = false;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (mp[i][j] != '.') continue;
      if (judge(i, j)) {
        flag = true;
        break;
      }
    }
  }
  if (flag)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
