#include <bits/stdc++.h>
using namespace std;
char pre[20][20];
int main() {
  for (int i = 1; i <= 10; i++) scanf("%s", pre[i]);
  for (int i = 1; i <= 10; i++) {
    for (int j = 0; j < 10; j++) {
      if (pre[i][j] == 'X') {
        int s = 1, d = 0;
        for (int k = j + 1; k < 10; k++) {
          if (pre[i][k] == 'X')
            s++;
          else if (pre[i][k] == 'O')
            break;
          else if (pre[i][k] == '.') {
            d++;
            if (d > 1) break;
            s++;
          }
          if (s == 5) {
            printf("YES\n");
            return 0;
          }
        }
        s = 1, d = 0;
        for (int k = j - 1; k >= 0; k--) {
          if (pre[i][k] == 'X')
            s++;
          else if (pre[i][k] == 'O')
            break;
          else if (pre[i][k] == '.') {
            d++;
            if (d > 1) break;
            s++;
          }
          if (s == 5) {
            printf("YES\n");
            return 0;
          }
        }
        s = 1, d = 0;
        for (int k = i - 1; k >= 0; k--) {
          if (pre[k][j] == 'X')
            s++;
          else if (pre[k][j] == 'O')
            break;
          else if (pre[k][j] == '.') {
            d++;
            if (d > 1) break;
            s++;
          }
          if (s == 5) {
            printf("YES\n");
            return 0;
          }
        }
        s = 1, d = 0;
        for (int k = i + 1; k < 10; k++) {
          if (pre[k][j] == 'X')
            s++;
          else if (pre[k][j] == 'O')
            break;
          else if (pre[k][j] == '.') {
            d++;
            if (d > 1) break;
            s++;
          }
          if (s == 5) {
            printf("YES\n");
            return 0;
          }
        }
        s = 1, d = 0;
        for (int p = i + 1, q = j + 1; p < 10 && q < 10; p++, q++) {
          if (pre[p][q] == 'X')
            s++;
          else if (pre[p][q] == 'O')
            break;
          else if (pre[p][q] == '.') {
            d++;
            if (d > 1) break;
            s++;
          }
          if (s == 5) {
            printf("YES\n");
            return 0;
          }
        }
        s = 1, d = 0;
        for (int p = i - 1, q = j + 1; p >= 0 && q < 10; p--, q++) {
          if (pre[p][q] == 'X')
            s++;
          else if (pre[p][q] == 'O')
            break;
          else if (pre[p][q] == '.') {
            d++;
            if (d > 1) break;
            s++;
          }
          if (s == 5) {
            printf("YES\n");
            return 0;
          }
        }
        s = 1, d = 0;
        for (int p = i - 1, q = j - 1; p >= 0 && q >= 0; p--, q--) {
          if (pre[p][q] == 'X')
            s++;
          else if (pre[p][q] == 'O')
            break;
          else if (pre[p][q] == '.') {
            d++;
            if (d > 1) break;
            s++;
          }
          if (s == 5) {
            printf("YES\n");
            return 0;
          }
        }
        s = 1, d = 0;
        for (int p = i + 1, q = j - 1; p <= 10 && q >= 0; p++, q--) {
          if (pre[p][q] == 'O') break;
          if (pre[p][q] == 'X') s++;
          if (pre[p][q] == '.') {
            d++;
            if (d > 1) break;
            s++;
          }
          if (s == 5) {
            printf("YES\n");
            return 0;
          }
        }
      }
    }
  }
  printf("NO\n");
  return 0;
}
