#include <bits/stdc++.h>
using namespace std;
char mp[13][13];
bool check(int x, int y) {
  int num = 1;
  for (int i = x - 1; i >= 1; i--) {
    if (mp[i][y] == 'X')
      num++;
    else
      break;
  }
  for (int i = x + 1; i <= 10; i++) {
    if (mp[i][y] == 'X')
      num++;
    else
      break;
  }
  if (num >= 5) return true;
  num = 1;
  for (int j = y - 1; j >= 1; j--) {
    if (mp[x][j] == 'X')
      num++;
    else
      break;
  }
  for (int j = y + 1; j <= 10; j++) {
    if (mp[x][j] == 'X')
      num++;
    else
      break;
  }
  if (num >= 5) return true;
  num = 1;
  for (int k = 1; x + k <= 10 && y + k <= 10; k++) {
    if (mp[x + k][y + k] == 'X')
      num++;
    else
      break;
  }
  for (int k = 1; x - k >= 1 && y - k >= 1; k++) {
    if (mp[x - k][y - k] == 'X')
      num++;
    else
      break;
  }
  if (num >= 5) return true;
  num = 1;
  for (int k = 1; x + k <= 10 && y - k >= 1; k++) {
    if (mp[x + k][y - k] == 'X')
      num++;
    else
      break;
  }
  for (int k = 1; x - k >= 1 && y + k <= 10; k++) {
    if (mp[x - k][y + k] == 'X')
      num++;
    else
      break;
  }
  if (num >= 5) return true;
  return false;
}
int main() {
  for (int i = 1; i <= 10; i++) scanf("%s", mp[i] + 1);
  for (int i = 1; i <= 10; i++) {
    for (int j = 1; j <= 10; j++) {
      if (mp[i][j] == '.' && check(i, j)) {
        puts("YES");
        return 0;
      }
    }
  }
  puts("NO");
  return 0;
}
