#include <bits/stdc++.h>
using namespace std;
const int N = 10;
char pic[N][N + 1];
bool work(int x, int y) {
  int r = y + 5, xx = 0, dot = 0;
  if (r <= N)
    for (int i = y; i < r; ++i) {
      xx += (pic[x][i] == 'X');
      dot += pic[x][i] == '.';
    }
  if (xx == 4 && dot == 1) return true;
  xx = 0, dot = 0, r = x + 5;
  if (r <= N)
    for (int i = x; i < r; ++i) {
      xx += pic[i][y] == 'X';
      dot += pic[i][y] == '.';
    }
  if (xx == 4 && dot == 1) return true;
  r = x + 5, xx = dot = 0;
  if (r <= N && y + 5 <= N) {
    for (int i = x, j = y; i < r; ++i, ++j) {
      xx += pic[i][j] == 'X';
      dot += pic[i][j] == '.';
    }
  }
  if (xx == 4 && dot == 1) return true;
  r = y + 5, xx = dot = 0;
  if (x - 4 >= 0 && r <= N)
    for (int i = x, j = y; j < r; ++j, --i) {
      xx += pic[i][j] == 'X';
      dot += pic[i][j] == '.';
    }
  if (xx == 4 && dot == 1) return true;
  return false;
}
int main() {
  for (int i = 0; i < N; ++i) scanf("%s", pic[i]);
  int i;
  for (i = 0; i < N; ++i)
    for (int j = 0; j < N; ++j) {
      if (work(i, j)) {
        puts("YES");
        j = N, i = N;
      }
    }
  if (i == N) puts("NO");
  return 0;
}
