#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
const int M = 1e6 + 5;
char s[10][10];
int main() {
  for (int i = 0; i < 10; i++) {
    scanf("%s", s[i]);
  }
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      if (s[i][j] != '.') continue;
      int tot = 0;
      for (int k = i - 1; k >= 0; k--) {
        if (s[k][j] != 'X') {
          break;
        }
        tot++;
      }
      for (int k = i + 1; k < 10; k++) {
        if (s[k][j] != 'X') {
          break;
        }
        tot++;
      }
      if (tot >= 4) {
        cout << "YES";
        return 0;
      }
      tot = 0;
      for (int k = j - 1; k >= 0; k--) {
        if (s[i][k] != 'X') {
          break;
        }
        tot++;
      }
      for (int k = j + 1; k <= 9; k++) {
        if (s[i][k] != 'X') {
          break;
        }
        tot++;
      }
      if (tot >= 4) {
        cout << "YES";
        return 0;
      }
      tot = 0;
      for (int k = i - 1, l = j - 1; k >= 0 && l >= 0; k--, l--) {
        if (s[k][l] != 'X') {
          break;
        }
        tot++;
      }
      for (int k = i + 1, l = j + 1; k < 10 && l < 10; k++, l++) {
        if (s[k][l] != 'X') {
          break;
        }
        tot++;
      }
      if (tot >= 4) {
        cout << "YES";
        return 0;
      }
      tot = 0;
      for (int k = i - 1, l = j + 1; k >= 0 && l < 10; k--, l++) {
        if (s[k][l] != 'X') {
          break;
        }
        tot++;
      }
      for (int k = i + 1, l = j - 1; k < 10 && l >= 0; k++, l--) {
        if (s[k][l] != 'X') {
          break;
        }
        tot++;
      }
      if (tot >= 4) {
        cout << "YES";
        return 0;
      }
    }
  }
  cout << "NO";
}
