#include <bits/stdc++.h>
int cmp(const void *x, const void *y) { return *(int *)x - *(int *)y; }
int main() {
  char chess[11][11];
  int i, j;
  for (i = 0; i < 10; i++) {
    scanf("%s", chess[i]);
  }
  for (i = 0; i < 10; i++) {
    for (j = 0; j < 10; j++) {
      int k, count;
      if (chess[i][j] != '.') continue;
      count = 0;
      k = j + 1;
      while (k < 10 && chess[i][k] == 'X') {
        count++;
        k++;
      }
      k = j - 1;
      while (k >= 0 && chess[i][k] == 'X') {
        count++;
        k--;
      }
      if (count >= 4) {
        printf("YES\n");
        return 0;
      }
      count = 0;
      k = i + 1;
      while (k < 10 && chess[k][j] == 'X') {
        count++;
        k++;
      }
      k = i - 1;
      while (k >= 0 && chess[k][j] == 'X') {
        count++;
        k--;
      }
      if (count >= 4) {
        printf("YES\n");
        return 0;
      }
      count = 0;
      k = 1;
      while ((i + k < 10) && (j + k < 10) && chess[i + k][j + k] == 'X') {
        count++;
        k++;
      }
      k = 1;
      while ((i - k >= 0) && (j - k >= 0) && chess[i - k][j - k] == 'X') {
        count++;
        k++;
      }
      if (count >= 4) {
        printf("YES\n");
        return 0;
      }
      count = 0;
      k = 1;
      while ((i + k < 10) && (j - k >= 0) && chess[i + k][j - k] == 'X') {
        count++;
        k++;
      }
      k = 1;
      while ((i - k >= 0) && (j + k < 10) && chess[i - k][j + k] == 'X') {
        count++;
        k++;
      }
      if (count >= 4) {
        printf("YES\n");
        return 0;
      }
    }
  }
  printf("NO\n");
  return 0;
}
