#include <bits/stdc++.h>
int main() {
  char b[11][11];
  int dx[][5] = {
      {0, 0, 0, 0, 0}, {-2, -1, 0, 1, 2}, {-2, -1, 0, 1, 2}, {-2, -1, 0, 1, 2}};
  int dy[][5] = {
      {-2, -1, 0, 1, 2}, {0, 0, 0, 0, 0}, {-2, -1, 0, 1, 2}, {2, 1, 0, -1, -2}};
  for (int i = 0; i < 10; i++) scanf("%s", b[i]);
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      for (int k = 0; k < 4; k++) {
        int cx = 0, cd = 0;
        for (int l = 0; l < 5; l++) {
          if (i + dx[k][l] < 0 || i + dx[k][l] > 9 || j + dy[k][l] < 0 ||
              j + dy[k][l] > 9) {
            cx = 0;
            break;
          }
          if (b[i + dx[k][l]][j + dy[k][l]] == 'X') cx++;
          if (b[i + dx[k][l]][j + dy[k][l]] == '.') cd++;
        }
        if (cx >= 5 || (cx == 4 && cd == 1)) {
          printf("YES\n");
          return 0;
        }
      }
    }
  }
  printf("NO\n");
  return 0;
}
