#include <bits/stdc++.h>
using namespace std;
long double PI = acosl(-1);
bool compare_int(int a, int b) { return (a > b); }
bool compare_string(string a, string b) { return a.size() < b.size(); }
bool compare_pair(const pair<int, int> &a, const pair<int, int> &b) {
  if (a.second == b.second)
    return a.first < b.first;
  else
    return (a.second > b.second);
}
bool cmp(pair<string, int> x, pair<string, int> y) {
  return (x.second < y.second);
}
const int fx[] = {+0, +0, +1, -1, -1, +1, -1, +1};
const int fy[] = {-1, +1, +0, +0, +1, +1, -1, -1};
void NA() {
  printf("NO\n");
  exit(0);
}
void YA() {
  printf("YES\n");
  exit(0);
}
int32_t main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n = 10;
  string s[n];
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      int Max = 0, tot = 0;
      if (s[i][j] == 'O') continue;
      if (s[i][j] == 'X') tot++;
      for (int k = 0; k < 8; k++) {
        int m = 4, cnt = 0, dot = 0;
        int xx = i, yy = j;
        while (m--) {
          if (xx + fx[k] >= 0 and xx + fx[k] < 10 and yy + fy[k] >= 0 and
              yy + fy[k] < 10) {
            if (s[xx + fx[k]][yy + fy[k]] == 'X')
              cnt++;
            else if (s[xx + fx[k]][yy + fy[k]] == 'O')
              cnt = 0;
            else
              dot++;
          }
          xx += fx[k];
          yy += fy[k];
        }
        if (dot < 2) {
          if (tot > 0 and cnt + dot == 4)
            YA();
          else if (tot == 0 and dot == 0 and cnt == 4)
            YA();
        }
      }
    }
  }
  NA();
}
