#include <bits/stdc++.h>
using namespace std;
char mp[12][12];
const int dx[] = {1, 1, 1, 0};
const int dy[] = {1, 0, -1, 1};
inline bool isempty(int i, int j) {
  return i >= 0 && j >= 0 && i < 10 && j < 10 && mp[i][j] == '.';
}
inline bool iscross(int i, int j) {
  return i >= 0 && j >= 0 && i < 10 && j < 10 && mp[i][j] == 'X';
}
int main() {
  for (int i = 0; i < 10; ++i) {
    scanf("%s", mp[i]);
  }
  int empty, cross;
  bool win = false;
  for (int i = 0; !win && i < 10; ++i) {
    for (int j = 0; !win && j < 10; ++j)
      if (mp[i][j] == '.' || mp[i][j] == 'X') {
        for (int k = 0; !win && k < 4; ++k) {
          empty = 0, cross = 0;
          for (int d = 0; d < 5; ++d) {
            if (isempty(i + dx[k] * d, j + dy[k] * d)) {
              ++empty;
            }
            if (iscross(i + dx[k] * d, j + dy[k] * d)) {
              ++cross;
            }
          }
          if (empty == 1 && cross == 4) {
            win = true;
          }
        }
      }
  }
  if (win) {
    puts("YES");
  } else {
    puts("NO");
  }
  return 0;
}
