#include <bits/stdc++.h>
using namespace std;
int main() {
  string board[10];
  for (int i = 0; i < 10; i++) cin >> board[i];
  int a = 0, b = 0;
  int l;
  int n = 10;
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      if (board[i][j] == '.') {
        a = 0, b = 0;
        int k = j - 1;
        while (k >= 0 && a < 5) {
          if (board[i][k] == 'X')
            a++, k--;
          else
            break;
        }
        if (a >= 4) {
          cout << "YES";
          return 0;
        }
        b = 0;
        k = j + 1;
        while (b < 5 && k < n) {
          if (board[i][k] == 'X')
            b++, k++;
          else
            break;
        }
        if ((b >= 4) || ((a + b) >= 4)) {
          cout << "YES";
          return 0;
        }
        a = 0, b = 0;
        k = i - 1;
        while (k >= 0 && a < 5) {
          if (board[k][j] == 'X')
            a++, k--;
          else
            break;
        }
        if (a >= 4) {
          cout << "YES";
          return 0;
        }
        b = 0;
        k = i + 1;
        while (b < 5 && k < n) {
          if (board[k][j] == 'X')
            b++, k++;
          else
            break;
        }
        if ((b >= 4) || ((a + b) >= 4)) {
          cout << "YES";
          return 0;
        }
        a = 0, b = 0;
        k = i - 1;
        l = j - 1;
        while (k >= 0 && l >= 0 && a < 5) {
          if (board[k][l] == 'X')
            a++, k--, l--;
          else
            break;
        }
        if (a >= 4) {
          cout << "YES";
          return 0;
        }
        b = 0;
        k = i + 1;
        l = j + 1;
        while (k < n && l < n && b < 5) {
          if (board[k][l] == 'X')
            b++, k++, l++;
          else
            break;
        }
        if ((b >= 4) || ((a + b) >= 4)) {
          cout << "YES";
          return 0;
        }
        a = 0, b = 0;
        k = i - 1;
        l = j + 1;
        while (k >= 0 && l < n && a < 5) {
          if (board[k][l] == 'X')
            a++, k--, l++;
          else
            break;
        }
        if (a >= 4) {
          cout << "YES";
          return 0;
        }
        b = 0;
        k = i + 1;
        l = j - 1;
        while (k < n && l >= 0 && b < 5) {
          if (board[k][l] == 'X')
            b++, k++, l--;
          else
            break;
        }
        if ((b >= 4) || ((a + b) >= 4)) {
          cout << "YES";
          return 0;
        }
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
