#include <bits/stdc++.h>
using namespace std;
long long n = 10;
string str[10];
bool check_it(long long x, long long y) {
  long long cnt = 0, dcnt = 0;
  if ((x + 4) < n) {
    if (str[x][y] == 'X') cnt++;
    if (str[x][y] == '.') dcnt++;
    if (str[x + 1][y] == 'X') cnt++;
    if (str[x + 1][y] == '.') dcnt++;
    if (str[x + 2][y] == 'X') cnt++;
    if (str[x + 2][y] == '.') dcnt++;
    if (str[x + 3][y] == 'X') cnt++;
    if (str[x + 3][y] == '.') dcnt++;
    if (str[x + 4][y] == 'X') cnt++;
    if (str[x + 4][y] == '.') dcnt++;
  }
  if (cnt == 4 && dcnt == 1) return true;
  cnt = 0;
  dcnt = 0;
  if ((y + 4) < n) {
    if (str[x][y] == 'X') cnt++;
    if (str[x][y] == '.') dcnt++;
    if (str[x][y + 1] == 'X') cnt++;
    if (str[x][y + 1] == '.') dcnt++;
    if (str[x][y + 2] == 'X') cnt++;
    if (str[x][y + 2] == '.') dcnt++;
    if (str[x][y + 3] == 'X') cnt++;
    if (str[x][y + 3] == '.') dcnt++;
    if (str[x][y + 4] == 'X') cnt++;
    if (str[x][y + 4] == '.') dcnt++;
  }
  if (cnt == 4 && dcnt == 1) return true;
  cnt = 0;
  dcnt = 0;
  if ((x + 4) < n && (y + 4) < n) {
    if (str[x][y] == 'X') cnt++;
    if (str[x][y] == '.') dcnt++;
    if (str[x + 1][y + 1] == 'X') cnt++;
    if (str[x + 1][y + 1] == '.') dcnt++;
    if (str[x + 2][y + 2] == 'X') cnt++;
    if (str[x + 2][y + 2] == '.') dcnt++;
    if (str[x + 3][y + 3] == 'X') cnt++;
    if (str[x + 3][y + 3] == '.') dcnt++;
    if (str[x + 4][y + 4] == 'X') cnt++;
    if (str[x + 4][y + 4] == '.') dcnt++;
  }
  if (cnt == 4 && dcnt == 1) return true;
  cnt = 0;
  dcnt = 0;
  if ((x + 4) < n && (y - 4) >= 0) {
    if (str[x][y] == 'X') cnt++;
    if (str[x][y] == '.') dcnt++;
    if (str[x + 1][y - 1] == 'X') cnt++;
    if (str[x + 1][y - 1] == '.') dcnt++;
    if (str[x + 2][y - 2] == 'X') cnt++;
    if (str[x + 2][y - 2] == '.') dcnt++;
    if (str[x + 3][y - 3] == 'X') cnt++;
    if (str[x + 3][y - 3] == '.') dcnt++;
    if (str[x + 4][y - 4] == 'X') cnt++;
    if (str[x + 4][y - 4] == '.') dcnt++;
  }
  if (cnt == 4 && dcnt == 1) return true;
  return false;
}
int main() {
  for (long long i = 0; i < 10; i++) cin >> str[i];
  for (long long i = 0; i < n; i++) {
    for (long long j = 0; j < n; j++) {
      if (check_it(i, j)) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO";
  return 0;
}
