#include <bits/stdc++.h>
using namespace std;
const double sn = 1e-6;
char arr[15][15];
bool won() {
  int c = 0;
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      if (arr[i][j] == 'X') {
        c++;
        if (c >= 5) return true;
      } else {
        c = 0;
      }
    }
    c = 0;
  }
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      if (arr[j][i] == 'X') {
        c++;
        if (c >= 5) return true;
      } else {
        c = 0;
      }
    }
    c = 0;
  }
  for (int i = 9, j = 0;;) {
    for (int k = i, l = j; k < 10 && l < 10; k++, l++) {
      if (arr[k][l] == 'X') {
        c++;
        if (c >= 5) return true;
      } else {
        c = 0;
      }
    }
    c = 0;
    if (i != 0)
      i--;
    else if (j != 9)
      j++;
    else
      break;
  }
  for (int i = 9, j = 9;;) {
    for (int k = i, l = j; k < 10 && l >= 0; k++, l--) {
      if (arr[k][l] == 'X') {
        c++;
        if (c >= 5) return true;
      } else {
        c = 0;
      }
    }
    c = 0;
    if (i != 0)
      i--;
    else if (j != 0)
      j--;
    else
      break;
  }
  return false;
}
int main() {
  for (int i = 0; i < 10; i++) scanf("%s", arr[i]);
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      if (arr[i][j] == '.') {
        arr[i][j] = 'X';
        if (won()) {
          printf("YES\n");
          return 0;
        }
        arr[i][j] = '.';
      }
    }
  }
  printf("NO\n");
  return 0;
}
