#include <bits/stdc++.h>
using namespace std;
set<long long> gera_primos(long long n) {
  set<long long> primos;
  vector<bool> crivo(n);
  primos.insert(2);
  for (long long i = 3; i <= n; i += 2) {
    if (crivo[i]) continue;
    primos.insert(i);
    for (long long j = i; j <= n; j += i) {
      crivo[j] = true;
    }
  }
  return primos;
}
struct Node {
  long long id;
  bool visitado;
  long long n;
  vector<long long> adj;
  Node() {
    static long long i = 0;
    id = i++;
  }
};
char a[20][20];
int main() {
  for (long long i = 5; i < (long long)15; i++) {
    string s;
    cin >> s;
    for (long long j = 5; j < (long long)15; j++) {
      a[i][j] = s[j - 5];
    }
  }
  for (long long i = 5; i < (long long)15; i++) {
    for (long long j = 5; j < (long long)15; j++) {
      if (a[i][j] == '.') {
        long long h = 0, v = 0, d1 = 0, d2 = 0;
        long long a1 = 0, a2 = 0;
        for (long long k = -1; a[i + k][j] == 'X'; k--) {
          if (a[i + k][j] == 'X') h++;
        }
        for (long long k = 1; a[i + k][j] == 'X'; k++) {
          if (a[i + k][j] == 'X') h++;
        }
        for (long long k = -1; a[i][j + k] == 'X'; k--) {
          if (a[i][j + k] == 'X') v++;
        }
        for (long long k = 1; a[i][j + k] == 'X'; k++) {
          if (a[i][j + k] == 'X') v++;
        }
        for (long long k = -1; a[i + k][j + k] == 'X'; k--) {
          if (a[i + k][j + k] == 'X') d1++;
        }
        for (long long k = 1; a[i + k][j + k] == 'X'; k++) {
          if (a[i + k][j + k] == 'X') d1++;
        }
        for (long long k = -1; a[i + k][j - k] == 'X'; k--) {
          if (a[i + k][j - k] == 'X') d2++;
        }
        for (long long k = 1; a[i + k][j - k] == 'X'; k++) {
          if (a[i + k][j - k] == 'X') d2++;
        }
        if (max({h, v, d1, d2}) >= 4) {
          puts("YES");
          return 0;
        }
      }
    }
  }
  puts("NO");
}
