#include <bits/stdc++.h>
char board[10][15];
const char dx[8] = {1, 1, 1, 0, 0, -1, -1, -1};
const char dy[8] = {1, 0, -1, 1, -1, 1, 0, -1};
int isInBound(int newX, int newY) {
  return (0 <= newX && newX < 10 && 0 <= newY && newY < 10);
}
int isWin(int x, int y) {
  int newX, newY;
  for (int d = 0; d < 4; d++) {
    int length = 1;
    newX = x + dx[d];
    newY = y + dy[d];
    while (isInBound(newX, newY) && board[newX][newY] == 'X') {
      length++;
      if (length >= 5) break;
      newX = newX + dx[d];
      newY = newY + dy[d];
    }
    newX = x + dx[7 - d];
    newY = y + dy[7 - d];
    while (isInBound(newX, newY) && board[newX][newY] == 'X') {
      length++;
      if (length >= 5) break;
      newX = newX + dx[7 - d];
      newY = newY + dy[7 - d];
    }
    if (length >= 5) return 1;
  }
  return 0;
}
int main() {
  for (int x = 0; x < 10; x++) scanf("%s", board[x]);
  for (int x = 0; x < 10; x++)
    for (int y = 0; y < 10; y++) {
      if (board[x][y] == '.') {
        board[x][y] = 'X';
        if (isWin(x, y)) {
          printf("YES\n");
          return 0;
        }
        board[x][y] = '.';
      }
    }
  printf("NO\n");
  return 0;
}
