#include <bits/stdc++.h>
using namespace std;
const int maxn = 15;
const int maxe = 1086 * 1086 * 4;
const int mod = 1000000007;
const double eps = 1e-6;
char s[maxn][maxn];
int n = 10;
bool is_x(int x, int y) {
  if (x < 0 || x >= n || y < 0 || y >= n) return false;
  return s[x][y] == 'X';
}
bool check(int x, int y) {
  int cnt = 0;
  for (int i = x; i < n; i++)
    if (is_x(i, y))
      cnt++;
    else
      break;
  ;
  for (int i = x - 1; i >= 0; i--)
    if (is_x(i, y))
      cnt++;
    else
      break;
  ;
  if (cnt >= 5) return true;
  cnt = 0;
  for (int i = y; i < n; i++)
    if (is_x(x, i))
      cnt++;
    else
      break;
  ;
  for (int i = y - 1; i >= 0; i--)
    if (is_x(x, i))
      cnt++;
    else
      break;
  ;
  if (cnt >= 5) return true;
  cnt = 0;
  for (int i = 0; i < n; i++)
    if (is_x(x + i, y + i))
      cnt++;
    else
      break;
  ;
  for (int i = -1; i >= -n; i--)
    if (is_x(x + i, y + i))
      cnt++;
    else
      break;
  ;
  if (cnt >= 5) return true;
  cnt = 0;
  for (int i = 0; i < n; i++)
    if (is_x(x + i, y - i))
      cnt++;
    else
      break;
  ;
  for (int i = -1; i >= -n; i--)
    if (is_x(x + i, y - i))
      cnt++;
    else
      break;
  ;
  if (cnt >= 5) return true;
  return false;
}
int main() {
  n = 10;
  for (int i = 0; i < n; i++) scanf("%s", s[i]);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++) {
      if (s[i][j] == '.') {
        s[i][j] = 'X';
        if (check(i, j)) {
          puts("YES");
          return 0;
        }
        s[i][j] = '.';
      }
    }
  puts("NO");
}
