#include <bits/stdc++.h>
using namespace std;
int plane[30][30];
int bias = 10;
char s[20];
bool eval() {
  for (int i = bias; i < bias + 10; i++)
    for (int j = bias; j < bias + 10; j++) {
      int s1(0), s2(0), s3(0), s4(0);
      for (int k = -2; k <= 2; k++) {
        s1 += plane[i + k][j];
        s2 += plane[i][j + k];
        s3 += plane[i + k][j + k];
        s4 += plane[i + k][j - k];
      }
      if (s1 >= 9 || s2 >= 9 || s3 >= 9 || s4 >= 9) return true;
    }
  return false;
}
int main() {
  memset(plane, 0, sizeof(plane));
  for (int i = 0; i < 10; i++) {
    scanf("%s", &s);
    for (int j = 0; j < 10; j++) {
      if (s[j] == 'X')
        plane[i + bias][j + bias] = 2;
      else if (s[j] == '.')
        plane[i + bias][j + bias] = 1;
    }
  }
  bool ans = eval();
  if (ans)
    printf("YES\n");
  else
    printf("NO\n");
}
