#include <bits/stdc++.h>
int horizontal(char matrix[][10], int i, int j) {
  int sumx = 0;
  int sumponto = 0;
  for (int k = 0; k < 5 && k + i < 10; k++) {
    if (matrix[i + k][j] == 'X') {
      sumx++;
    } else if (matrix[i + k][j] == '.') {
      sumponto++;
    }
  }
  if (sumx == 4 && sumponto == 1) {
    return 1;
  } else {
    return 0;
  }
}
int vertical(char matrix[][10], int i, int j) {
  int sumx = 0;
  int sumponto = 0;
  for (int k = 0; k < 5 && j + k < 10; k++) {
    if (matrix[i][j + k] == 'X') {
      sumx++;
    } else if (matrix[i][j + k] == '.') {
      sumponto++;
    }
  }
  if (sumx == 4 && sumponto == 1) {
    return 1;
  } else {
    return 0;
  }
}
int diagonal1(char matrix[][10], int i, int j) {
  int sumx = 0;
  int sumponto = 0;
  for (int k = 0; k < 5 && k + i < 10 && k + j < 10; k++) {
    if (matrix[i + k][j + k] == 'X') {
      sumx++;
    } else if (matrix[i + k][j + k] == '.') {
      sumponto++;
    }
  }
  if (sumx == 4 && sumponto == 1) {
    return 1;
  } else {
    return 0;
  }
}
int diagonal2(char matrix[][10], int i, int j) {
  int sumx = 0;
  int sumponto = 0;
  for (int k = 0; k < 5 && i + k <= 10 && j - k >= 0; k++) {
    if (matrix[i + k][j - k] == 'X') {
      sumx++;
    } else if (matrix[i + k][j - k] == '.') {
      sumponto++;
    }
  }
  if (sumx == 4 && sumponto == 1) {
    return 1;
  } else {
    return 0;
  }
}
int main() {
  char matrix[10][10];
  int i = 0;
  char s[12];
  int flag = 0;
  while (i < 10) {
    scanf("%s", s);
    for (int j = 0; j < 10; j++) {
      matrix[i][j] = s[j];
    }
    i++;
  }
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      if (horizontal(matrix, i, j) || vertical(matrix, i, j) ||
          diagonal1(matrix, i, j) || diagonal2(matrix, i, j)) {
        flag = 1;
        break;
      }
    }
  }
  if (flag == 1) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
  return 0;
}
