#include <bits/stdc++.h>
using namespace std;
const int dx[] = {-1, -1, 0, 1, 1, 1, 0, -1};
const int dy[] = {0, 1, 1, 1, 0, -1, -1, -1};
char field[10][10];
bool check() {
  bool res = false;
  for (int i = 0; i < 10; ++i) {
    for (int j = 0; j < 10; ++j) {
      for (int d = 0; d < 8; ++d) {
        int cnt = 0;
        int cx = i;
        int cy = j;
        while (0 <= cx && cx < 10 && 0 <= cy && cy < 10 &&
               field[cx][cy] == 'X') {
          cx += dx[d];
          cy += dy[d];
          ++cnt;
        }
        res = res || (cnt >= 5);
      }
    }
  }
  return res;
}
int main() {
  for (int i = 0; i < 10; ++i) scanf("%s\n", field[i]);
  bool res = check();
  for (int i = 0; i < 10; ++i) {
    for (int j = 0; j < 10; ++j) {
      if (field[i][j] == '.') {
        field[i][j] = 'X';
        res = res || check();
        if (res) return 0 * printf("YES");
        field[i][j] = '.';
      }
    }
  }
  printf("NO");
  return 0;
}
