#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) {
  if (a > b) return a;
  return b;
}
long long min(long long a, long long b) {
  if (a < b) return a;
  return b;
}
string g[11];
long long n = 10, m = 10;
bool ok() {
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      if (g[i][j] != 'X') continue;
      long long x = i, y = j, z = 0;
      while (x <= n && y <= m) {
        if (g[x][y] == 'X')
          z++;
        else
          break;
        x++;
      }
      if (z >= 5) return 1;
      x = i;
      y = j;
      z = 0;
      while (x <= n && y <= m) {
        if (g[x][y] == 'X')
          z++;
        else
          break;
        y++;
      }
      if (z >= 5) return 1;
      x = i;
      y = j;
      z = 0;
      while (x <= n && y <= m) {
        if (g[x][y] == 'X')
          z++;
        else
          break;
        x++;
        y++;
      }
      if (z >= 5) return 1;
      x = i;
      y = j;
      z = 0;
      while (x <= n && y <= m) {
        if (g[x][y] == 'X')
          z++;
        else
          break;
        x++;
        y--;
      }
      if (z >= 5) return 1;
    }
  }
  return 0;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  for (long long i = 1; i <= n; i++) {
    cin >> g[i];
    g[i] = '#' + g[i];
  }
  for (long long i = 1; i <= n; i++) {
    for (long long j = 1; j <= m; j++) {
      if (g[i][j] == '.') {
        g[i][j] = 'X';
        if (ok()) {
          cout << "YES";
          return 0;
        }
        g[i][j] = '.';
      }
    }
  }
  cout << "NO";
}
