#include <bits/stdc++.h>
char s[20][20];
int check(int x, int y) {
  int now = 1;
  int xx = x - 1;
  while (xx >= 0 && s[xx][y] == 'X') now++, xx--;
  xx = x + 1;
  while (xx < 10 && s[xx][y] == 'X') now++, xx++;
  if (now >= 5) return 1;
  int yy = y - 1;
  now = 1;
  while (yy >= 0 && s[x][yy] == 'X') now++, yy--;
  yy = y + 1;
  while (yy < 10 && s[x][yy] == 'X') now++, yy++;
  if (now >= 5) return 1;
  xx = x - 1;
  yy = y - 1;
  now = 1;
  while (xx >= 0 && yy >= 0 && s[xx][yy] == 'X') now++, yy--, xx--;
  xx = x + 1;
  yy = y + 1;
  while (xx < 10 && yy < 10 && s[xx][yy] == 'X') now++, yy++, xx++;
  if (now >= 5) return 1;
  xx = x - 1;
  yy = y + 1;
  now = 1;
  while (xx >= 0 && yy < 10 && s[xx][yy] == 'X') now++, yy++, xx--;
  xx = x + 1;
  yy = y - 1;
  while (xx < 10 && yy >= 0 && s[xx][yy] == 'X') now++, yy--, xx++;
  if (now >= 5) return 1;
  return 0;
}
int main() {
  for (int i = 0; i < 10; i++) scanf("%s", s[i]);
  for (int i = 0; i < 10; i++)
    for (int j = 0; j < 10; j++)
      if (s[i][j] == '.')
        if (check(i, j)) {
          puts("YES");
          goto out;
        }
  puts("NO");
out:;
  return 0;
}
