#include <bits/stdc++.h>
using namespace std;
const long long int mod = 1e9 + 7;
string s[10];
bool winning() {
  for (int i = (int)(0); i < (int)(10); i++) {
    for (int j = (int)(0); j < (int)(10); j++) {
      for (int dx = (int)(-1); dx < (int)(2); dx++) {
        for (int dy = (int)(-1); dy < (int)(2); dy++) {
          if (dx == 0 && dy == 0) continue;
          bool ok = true;
          for (int k = (int)(0); k < (int)(5); k++) {
            int nx = i + k * dx;
            int ny = j + k * dy;
            if (nx < 0 || nx >= 10 || ny < 0 || ny >= 10) {
              ok = false;
              break;
            }
            if (s[nx][ny] != 'X') {
              ok = false;
              break;
            }
          }
          if (ok) return true;
        }
      }
    }
  }
  return false;
}
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  for (int i = (int)(0); i < (int)(10); i++) cin >> s[i];
  for (int i = (int)(0); i < (int)(10); i++) {
    for (int j = (int)(0); j < (int)(10); j++) {
      if (s[i][j] != '.') continue;
      s[i][j] = 'X';
      if (winning()) {
        cout << "YES\n";
        return 0;
      }
      s[i][j] = '.';
    }
  }
  cout << "NO\n";
}
