#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9 + 7;
const int N = (int)2e5 + 10;
char c[11][11];
int p = 0, x = 0, o = 0;
void ch() {
  if (x >= 4) {
    puts("YES");
    exit(0);
  }
  x = 0;
}
int main() {
  for (int i = 1; i <= 10; i++) {
    for (int j = 1; j <= 10; j++) {
      cin >> c[i][j];
    }
  }
  for (int i = 1; i <= 10; i++) {
    for (int j = 1; j <= 10; j++) {
      if (c[i][j] == '.') {
        for (int k = j - 1; k > 0; k--) {
          if (c[i][k] == 'X')
            x++;
          else
            break;
        }
        for (int k = j + 1; k <= 10; k++) {
          if (c[i][k] == 'X')
            x++;
          else
            break;
        }
        ch();
        for (int k = i - 1; k > 0; k--) {
          if (c[k][j] == 'X')
            x++;
          else
            break;
        }
        for (int k = i + 1; k <= 10; k++) {
          if (c[k][j] == 'X')
            x++;
          else
            break;
        }
        ch();
        for (int k = i - 1, l = j + 1; k > 0 && l <= 10; k--, l++) {
          if (c[k][l] == 'X')
            x++;
          else
            break;
        }
        for (int k = i + 1, l = j - 1; k <= 10 && l > 0; k++, l--) {
          if (c[k][l] == 'X')
            x++;
          else
            break;
        }
        ch();
        for (int k = i - 1, l = j - 1; k > 0 && l > 0; k--, l--) {
          if (c[k][l] == 'X')
            x++;
          else
            break;
        }
        for (int k = i + 1, l = j + 1; k <= 10 && l <= 10; k++, l++) {
          if (c[k][l] == 'X')
            x++;
          else
            break;
        }
        ch();
      }
    }
  }
  puts("NO");
}
