#include <bits/stdc++.h>
using namespace std;
const int N = 0;
char a[10][10];
int one[] = {0, 0, 0, 0, 0};
int two[] = {0, 1, 2, 3, 4};
int three[] = {0, -1, -2, -3, -4};
void yes() {
  cout << "YES";
  exit(0);
}
void check() {
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      if (a[i][j] != 'X') continue;
      int nr, nc, ct = 0;
      for (int k = 0; k < 5; k++) {
        nr = i + three[k];
        nc = j + one[k];
        if (nr >= 0 && nr < 10 && nc >= 0 && nc < 10 && a[nr][nc] == 'X') ct++;
      }
      if (ct == 5) yes();
      ct = 0;
      for (int k = 0; k < 5; k++) {
        nr = i + three[k];
        nc = j + two[k];
        if (nr >= 0 && nr < 10 && nc >= 0 && nc < 10 && a[nr][nc] == 'X') ct++;
      }
      if (ct == 5) yes();
      ct = 0;
      for (int k = 0; k < 5; k++) {
        nr = i + one[k];
        nc = j + two[k];
        if (nr >= 0 && nr < 10 && nc >= 0 && nc < 10 && a[nr][nc] == 'X') ct++;
      }
      if (ct == 5) yes();
      ct = 0;
      for (int k = 0; k < 5; k++) {
        nr = i + two[k];
        nc = j + two[k];
        if (nr >= 0 && nr < 10 && nc >= 0 && nc < 10 && a[nr][nc] == 'X') ct++;
      }
      if (ct == 5) yes();
      ct = 0;
      for (int k = 0; k < 5; k++) {
        nr = i + two[k];
        nc = j + one[k];
        if (nr >= 0 && nr < 10 && nc >= 0 && nc < 10 && a[nr][nc] == 'X') ct++;
      }
      if (ct == 5) yes();
      ct = 0;
      for (int k = 0; k < 5; k++) {
        nr = i + two[k];
        nc = j + three[k];
        if (nr >= 0 && nr < 10 && nc >= 0 && nc < 10 && a[nr][nc] == 'X') ct++;
      }
      if (ct == 5) yes();
      ct = 0;
      for (int k = 0; k < 5; k++) {
        nr = i + one[k];
        nc = j + three[k];
        if (nr >= 0 && nr < 10 && nc >= 0 && nc < 10 && a[nr][nc] == 'X') ct++;
      }
      if (ct == 5) yes();
      ct = 0;
      for (int k = 0; k < 5; k++) {
        nr = i + three[k];
        nc = j + three[k];
        if (nr >= 0 && nr < 10 && nc >= 0 && nc < 10 && a[nr][nc] == 'X') ct++;
      }
      if (ct == 5) yes();
    }
  }
}
int main() {
  for (int i = 0; i < 10; i++) cin >> a[i];
  for (int i = 0; i < 10; i++)
    for (int j = 0; j < 10; j++)
      if (a[i][j] == '.') {
        a[i][j] = 'X';
        check();
        a[i][j] = '.';
      }
  cout << "NO";
}
