#include <bits/stdc++.h>
using namespace std;
const int EXP = 1e1 + 8;
const int DIM = 2e5 + 5;
const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
char mat[EXP][EXP];
bool verify(void) {
  for (int i = 1; i <= 10; ++i) {
    for (int j = 1; j <= 10; ++j) {
      bool ok1 = true, ok2 = true, ok3 = true, ok4 = (j >= 5);
      for (int k = 0; k < 5; ++k) {
        if (mat[i][j + k] != 'X') ok1 = false;
        if (mat[i + k][j] != 'X') ok2 = false;
        if (mat[i + k][j + k] != 'X') ok3 = false;
        if (j >= 5 && mat[i + k][j - k] != 'X') ok4 = false;
      }
      if (ok1 || ok2 || ok3 || ok4) return true;
    }
  }
  return false;
}
int main(void) {
  for (int i = 1; i <= 10; ++i) scanf("%s", mat[i] + 1);
  bool ok = false;
  for (int i = 1; i <= 10; ++i) {
    for (int j = 1; j <= 10; ++j) {
      if (mat[i][j] != '.') continue;
      mat[i][j] = 'X';
      ok |= verify();
      mat[i][j] = '.';
    }
  }
  if (ok)
    printf("YES");
  else
    printf("NO");
  return 0;
}
