#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long mod = 1e9 + 7;
const int Max = 3e5 + 10;
int n;
char mp[11][11];
int main() {
  for (int i = 1; i <= 10; i++) {
    scanf("%s", mp[i] + 1);
  }
  bool ok = false;
  for (int i = 1; i <= 10 && !ok; i++) {
    for (int j = 1; j <= 10 && !ok; j++) {
      if (mp[i][j] != 'X') continue;
      if (i <= 6 && mp[i + 1][j] != 'O' && mp[i + 2][j] != 'O' &&
          mp[i + 3][j] != 'O' && mp[i + 4][j] != 'O') {
        if ((mp[i + 1][j] == 'X') + (mp[i + 2][j] == 'X') +
                (mp[i + 3][j] == 'X') + (mp[i + 4][j] == 'X') ==
            3) {
          ok = true;
          break;
        }
      }
      if (j <= 6 && mp[i][j + 1] != 'O' && mp[i][j + 2] != 'O' &&
          mp[i][j + 3] != 'O' && mp[i][j + 4] != 'O') {
        if ((mp[i][j + 1] == 'X') + (mp[i][j + 2] == 'X') +
                (mp[i][j + 3] == 'X') + (mp[i][j + 4] == 'X') ==
            3) {
          ok = true;
          break;
        }
      }
      if (i <= 6 && j <= 6 && mp[i + 1][j + 1] != 'O' &&
          mp[i + 2][j + 2] != 'O' && mp[i + 3][j + 3] != 'O' &&
          mp[i + 4][j + 4] != 'O') {
        if ((mp[i + 1][j + 1] == 'X') + (mp[i + 2][j + 2] == 'X') +
                (mp[i + 3][j + 3] == 'X') + (mp[i + 4][j + 4] == 'X') ==
            3) {
          ok = true;
          break;
        }
      }
      if (i >= 5 && mp[i - 1][j] != 'O' && mp[i - 2][j] != 'O' &&
          mp[i - 3][j] != 'O' && mp[i - 4][j] != 'O') {
        if ((mp[i - 1][j] == 'X') + (mp[i - 2][j] == 'X') +
                (mp[i - 3][j] == 'X') + (mp[i - 4][j] == 'X') ==
            3) {
          ok = true;
          break;
        }
      }
      if (j >= 5 && mp[i][j - 1] != 'O' && mp[i][j - 2] != 'O' &&
          mp[i][j - 3] != 'O' && mp[i][j - 4] != 'O') {
        if ((mp[i][j - 1] == 'X') + (mp[i][j - 2] == 'X') +
                (mp[i][j - 3] == 'X') + (mp[i][j - 4] == 'X') ==
            3) {
          ok = true;
          break;
        }
      }
      if (i >= 5 && j >= 5 && mp[i - 1][j - 1] != 'O' &&
          mp[i - 2][j - 2] != 'O' && mp[i - 3][j - 3] != 'O' &&
          mp[i - 4][j - 4] != 'O') {
        if ((mp[i - 1][j - 1] == 'X') + (mp[i - 2][j - 2] == 'X') +
                (mp[i - 3][j - 3] == 'X') + (mp[i - 4][j - 4] == 'X') ==
            3) {
          ok = true;
          break;
        }
      }
      if (i <= 6 && j >= 5 && mp[i + 1][j - 1] != 'O' &&
          mp[i + 2][j - 2] != 'O' && mp[i + 3][j - 3] != 'O' &&
          mp[i + 4][j - 4] != 'O') {
        if ((mp[i + 1][j - 1] == 'X') + (mp[i + 2][j - 2] == 'X') +
                (mp[i + 3][j - 3] == 'X') + (mp[i + 4][j - 4] == 'X') ==
            3) {
          ok = true;
          break;
        }
      }
      if (i >= 5 && j <= 6 && mp[i - 1][j + 1] != 'O' &&
          mp[i - 2][j + 2] != 'O' && mp[i - 3][j + 3] != 'O' &&
          mp[i - 4][j + 4] != 'O') {
        if ((mp[i - 1][j + 1] == 'X') + (mp[i - 2][j + 2] == 'X') +
                (mp[i - 3][j + 3] == 'X') + (mp[i - 4][j + 4] == 'X') ==
            3) {
          ok = true;
          break;
        }
      }
    }
  }
  if (ok)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
