#include <bits/stdc++.h>
using namespace std;
char s[20][20];
bool judge(char ch) { return ch == 'X' ? true : false; }
bool check(int i, int j) {
  if (s[i][j] != '.') return false;
  s[i][j] = 'X';
  int cnt = 0;
  for (int ii = max(0, i - 5); ii < 10; ii++) {
    if (s[ii][j] == 'X') {
      cnt++;
    } else
      cnt = 0;
    if (cnt >= 5) {
      s[i][j] = '.';
      return true;
    }
  }
  cnt = 0;
  for (int jj = max(0, j - 5); jj < 10; jj++) {
    if (s[i][jj] == 'X') {
      cnt++;
    } else
      cnt = 0;
    if (cnt >= 5) {
      s[i][j] = '.';
      return true;
    }
  }
  cnt = 0;
  int ii, jj;
  int minn = min(i - max(0, i - 5), j - max(0, j - 5));
  for (ii = i - minn, jj = j - minn; ii < 10 && jj < 10; ii++, jj++) {
    if (s[ii][jj] == 'X')
      cnt++;
    else
      cnt = 0;
    if (cnt >= 5) {
      s[i][j] = '.';
      return true;
    }
  }
  cnt = 0;
  minn = min(i - max(0, i - 5), min(9, j + 5) - j);
  for (ii = i - minn, jj = j + minn; ii < 10 && jj >= 0; ii++, jj--) {
    if (s[ii][jj] == 'X')
      cnt++;
    else
      cnt = 0;
    if (cnt >= 5) {
      s[i][j] = '.';
      return true;
    }
  }
  s[i][j] = '.';
  return false;
}
int main() {
  for (int i = 0; i < 10; i++) scanf("%s", s[i]);
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      if (check(i, j)) {
        printf("YES\n");
        return 0;
      }
    }
  }
  puts("NO");
  return 0;
}
