#include <bits/stdc++.h>
using namespace std;
char a[20][20];
bool chack_row(int x, int y) {
  for (int i = 0; i <= 4; i++) {
    for (int j = 1; j <= i; j++) {
      if (a[x][y - j] != 'X') {
        goto a;
      }
    }
    for (int j = 1; j <= 4 - i; j++) {
      if (a[x][y + j] != 'X') {
        goto a;
      }
    }
    return true;
  a:;
  }
  return false;
}
bool chack_line(int x, int y) {
  for (int i = 0; i <= 4; i++) {
    for (int j = 1; j <= i; j++) {
      if (a[x - j][y] != 'X') {
        goto b;
      }
    }
    for (int j = 1; j <= 4 - i; j++) {
      if (a[x + j][y] != 'X') {
        goto b;
      }
    }
    return true;
  b:;
  }
  return false;
}
bool chack_dia(int x, int y) {
  for (int i = 0; i <= 4; i++) {
    for (int j = 1; j <= i; j++) {
      if (a[x - j][y - j] != 'X') {
        goto c;
      }
    }
    for (int j = 1; j <= 4 - i; j++) {
      if (a[x + j][y + j] != 'X') {
        goto c;
      }
    }
    return true;
  c:;
    for (int j = 1; j <= i; j++) {
      if (a[x - j][y + j] != 'X') {
        goto d;
      }
    }
    for (int j = 1; j <= 4 - i; j++) {
      if (a[x + j][y - j] != 'X') {
        goto d;
      }
    }
    return true;
  d:;
  }
  return false;
}
bool judge(int x, int y) {
  return chack_row(x, y) or chack_line(x, y) or chack_dia(x, y);
}
int main() {
  for (int i = 4; i < 14; i++) {
    for (int j = 4; j < 14; j++) {
      scanf("%c", &a[i][j]);
    }
    getchar();
  }
  for (int i = 4; i < 14; i++) {
    for (int j = 4; j < 14; j++) {
      if (a[i][j] == '.') {
        if (judge(i, j)) {
          printf("YES\n");
          goto end;
        }
      }
    }
  }
  printf("NO\n");
end:;
  return 0;
}
