#include <bits/stdc++.h>
using namespace std;
int n = 10, m = 10;
char grid[12][12];
bool valid(int i, int j) {
  return (i <= 10 && j <= 10 && i >= 1 && j >= 1 && grid[i][j] == 'X');
}
bool check(int i, int j) {
  int x = 0, y = 0;
  for (int k = i + 1; k <= 10; k++) {
    if (!valid(k, j)) break;
    x++;
  }
  for (int k = i - 1; k >= 1; k--) {
    if (!valid(k, j)) break;
    y++;
  }
  if (x + y + 1 >= 5) return true;
  x = 0, y = 0;
  for (int k = j + 1; k <= 10; k++) {
    if (!valid(i, k)) break;
    x++;
  }
  for (int k = j - 1; k >= 1; k--) {
    if (!valid(i, k)) break;
    y++;
  }
  if (x + y + 1 >= 5) return true;
  x = 0, y = 0;
  for (int k = i + 1, l = j + 1; k <= 10 && l <= 10; l++, k++) {
    if (!valid(k, l)) break;
    x++;
  }
  for (int k = i - 1, l = j - 1; k >= 1 && l >= 1; l--, k--) {
    if (!valid(k, l)) break;
    y++;
  }
  if (x + y + 1 >= 5) return true;
  x = 0, y = 0;
  for (int k = i + 1, l = j - 1; k <= 10 && l >= 1; l--, k++) {
    if (!valid(k, l)) break;
    x++;
  }
  for (int k = i - 1, l = j + 1; k >= 1 && l <= 10; l++, k--) {
    if (!valid(k, l)) break;
    y++;
  }
  if (x + y + 1 >= 5) return true;
  return false;
}
int main() {
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= m; j++) {
      cin >> grid[i][j];
    }
  }
  int ff = 0;
  for (int i = 1; i <= n; i++) {
    int f = 0;
    for (int j = 1; j <= m; j++) {
      if (grid[i][j] == '.' || grid[i][j] == 'X') {
        if (check(i, j)) {
          ff = 1;
          break;
        }
      }
    }
    if (ff == 1) break;
  }
  if (ff == 1)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
