#include <bits/stdc++.h>
using namespace std;
int main() {
  char arr[12][12];
  for (long long i = 0; i < 10; i++) {
    for (long long j = 0; j < 10; j++) cin >> arr[i][j];
  }
  for (long long i = 0; i < 10; i++) {
    for (long long j = 0; j < 10; j++) {
      if (arr[i][j] == 'X' || arr[i][j] == '.') {
        int cnt = 0;
        int flag = 0;
        int a = i, b = j;
        while (arr[a][b] != 'O' && a < 10 && b < 10) {
          if (arr[a][b] == 'X') {
            cnt++;
          } else if (arr[a][b] == '.') {
            if (flag == 0) {
              flag = 1;
              cnt++;
            } else
              break;
          } else if (arr[a][b] == 'O')
            break;
          a++, b++;
        }
        if (cnt >= 5 && flag == 1) {
          cout << "YES";
          return 0;
        }
        a = i, b = j, flag = 0, cnt = 0;
        while (arr[a][b] != 'O' && a < 10 && b < 10) {
          if (arr[a][b] == 'X') {
            cnt++;
          } else if (arr[a][b] == '.') {
            if (flag == 0) {
              flag = 1;
              cnt++;
            } else
              break;
          } else if (arr[a][b] == 'O')
            break;
          a++;
        }
        if (cnt >= 5 && flag == 1) {
          cout << "YES";
          return 0;
        }
        a = i, b = j, flag = 0, cnt = 0;
        while (arr[a][b] != 'O' && a < 10 && b < 10) {
          if (arr[a][b] == 'X') {
            cnt++;
          } else if (arr[a][b] == '.') {
            if (flag == 0) {
              flag = 1;
              cnt++;
            } else
              break;
          } else if (arr[a][b] == 'O')
            break;
          b++;
        }
        if (cnt >= 5 && flag == 1) {
          cout << "YES";
          return 0;
        }
        a = i, b = j, flag = 0, cnt = 0;
        while (arr[a][b] != 'O' && a >= 0 && b >= 0) {
          if (arr[a][b] == 'X') {
            cnt++;
          } else if (arr[a][b] == '.') {
            if (flag == 0) {
              flag = 1;
              cnt++;
            } else
              break;
          } else if (arr[a][b] == 'O')
            break;
          a++, b--;
        }
        if (cnt >= 5 && flag == 1) {
          cout << "YES";
          return 0;
        }
      }
    }
  }
  cout << "NO";
  return 0;
}
