#include <bits/stdc++.h>
using namespace std;
int caseno = 1;
typedef long long LL;
typedef unsigned long long ULL;
template <class T>
inline void SWAP(T &a, T &b) {
  T t = a;
  a = b;
  b = t;
}
inline LL POW(LL base, LL power) {
  LL res = base;
  if (power == 0) return 1;
  for (int I = 0; I < power - 1; I++) res *= base;
  return res;
}
int ToInt(string s) {
  int r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
double ToDouble(string s) {
  double r = 0;
  istringstream sin(s);
  sin >> r;
  return r;
}
string ToString(int n) {
  string s;
  stringstream convert;
  convert << n;
  s = convert.str();
  return s;
}
const int SIZE = 10 + 10;
string S[SIZE];
int main() {
  std::ios_base::sync_with_stdio(0);
  int T, I, J, K, N, n, m, cnt = 0, len, cross, dot, x, y;
  for (I = 0; I < 10; I++) cin >> S[I];
  for (I = 0; I < 10; I++) {
    for (J = 0; J < 10; J++) {
      if (S[I][J] == 'X') {
        cross = 0, dot = 0, cnt = 0;
        for (K = J; K >= 0; K--) {
          if (cnt >= 5) break;
          if (S[I][K] == 'X')
            cross++;
          else if (S[I][K] == '.')
            dot++;
          cnt++;
        }
        if (cross == 4 && dot == 1) {
          cout << "YES\n";
          return 0;
        }
        cross = 0, dot = 0, cnt = 0;
        for (K = J; K < 10; K++) {
          if (cnt >= 5) break;
          if (S[I][K] == 'X')
            cross++;
          else if (S[I][K] == '.')
            dot++;
          cnt++;
        }
        if (cross == 4 && dot == 1) {
          cout << "YES\n";
          return 0;
        }
        cross = 0, dot = 0, cnt = 0;
        for (K = I; K >= 0; K--) {
          if (cnt >= 5) break;
          if (S[K][J] == 'X')
            cross++;
          else if (S[K][J] == '.')
            dot++;
          cnt++;
        }
        if (cross == 4 && dot == 1) {
          cout << "YES\n";
          return 0;
        }
        cross = 0, dot = 0, cnt = 0;
        for (K = I; K < 10; K++) {
          if (cnt >= 5) break;
          if (S[K][J] == 'X')
            cross++;
          else if (S[K][J] == '.')
            dot++;
          cnt++;
        }
        if (cross == 4 && dot == 1) {
          cout << "YES\n";
          return 0;
        }
        cross = 0, dot = 0, cnt = 0;
        x = I, y = J;
        while (1) {
          if (x < 0 || y < 0) break;
          if (cnt >= 5) break;
          if (S[x][y] == 'X')
            cross++;
          else if (S[x][y] == '.')
            dot++;
          x--, y--;
          cnt++;
        }
        if (cross == 4 && dot == 1) {
          cout << "YES\n";
          return 0;
        }
        cross = 0, dot = 0, cnt = 0;
        x = I, y = J;
        while (1) {
          if (x < 0 || y >= 10) break;
          if (cnt >= 5) break;
          if (S[x][y] == 'X')
            cross++;
          else if (S[x][y] == '.')
            dot++;
          x--, y++;
          cnt++;
        }
        if (cross == 4 && dot == 1) {
          cout << "YES\n";
          return 0;
        }
        cross = 0, dot = 0, cnt = 0;
        x = I, y = J;
        while (1) {
          if (x >= 10 || y < 0) break;
          if (cnt >= 5) break;
          if (S[x][y] == 'X')
            cross++;
          else if (S[x][y] == '.')
            dot++;
          x++, y--;
          cnt++;
        }
        if (cross == 4 && dot == 1) {
          cout << "YES\n";
          return 0;
        }
        cross = 0, dot = 0, cnt = 0;
        x = I, y = J;
        while (1) {
          if (x >= 10 || y >= 10) break;
          if (cnt >= 5) break;
          if (S[x][y] == 'X')
            cross++;
          else if (S[x][y] == '.')
            dot++;
          x++, y++;
          cnt++;
        }
        if (cross == 4 && dot == 1) {
          cout << "YES\n";
          return 0;
        }
      }
    }
  }
  cout << "NO\n";
  return 0;
}
