#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n = 10;
  char a[n][n];
  for (long long i = 0; i < n; ++i) {
    for (long long j = 0; j < n; ++j) {
      cin >> a[i][j];
    }
  }
  for (long long i = 0; i < n; ++i) {
    for (long long j = 0; j + 4 < n; ++j) {
      long long cnt_x = 0;
      for (long long k = 0; k < 5; ++k) {
        if (a[i][j + k] == 'X') {
          cnt_x++;
        }
        if (a[i][j + k] == 'O') {
          cnt_x = -1;
        }
      }
      if (cnt_x == 4) {
        return cout << "YES\n", 0;
      }
    }
  }
  for (long long i = 0; i + 4 < n; ++i) {
    for (long long j = 0; j < n; ++j) {
      long long cnt_x = 0;
      for (long long k = 0; k < 5; ++k) {
        if (a[i + k][j] == 'X') {
          cnt_x++;
        }
        if (a[i + k][j] == 'O') {
          cnt_x = -1;
        }
      }
      if (cnt_x == 4) {
        return cout << "YES\n", 0;
      }
    }
  }
  for (long long i = 0; i + 4 < n; ++i) {
    for (long long j = 0; j + 4 < n; ++j) {
      long long cnt_x = 0;
      for (long long k = 0; k < 5; ++k) {
        if (a[i + k][j + k] == 'X') {
          cnt_x++;
        }
        if (a[i + k][j + k] == 'O') {
          cnt_x = -1;
        }
      }
      if (cnt_x == 4) {
        return cout << "YES\n", 0;
      }
    }
  }
  for (long long i = 0; i + 4 < n; ++i) {
    for (long long j = n - 1; j - 4 >= 0; --j) {
      long long cnt_x = 0;
      for (long long k = 0; k < 5; ++k) {
        if (a[i + k][j - k] == 'X') {
          cnt_x++;
        }
        if (a[i + k][j - k] == 'O') {
          cnt_x = -1;
        }
      }
      if (cnt_x == 4) {
        return cout << "YES\n", 0;
      }
    }
  }
  cout << "NO\n";
  return 0;
}
