#include <bits/stdc++.h>
using namespace std;
int main() {
  string str[11];
  int i, count1 = 0, x = 0, count2 = 0, j, k, l, y = 0, crosses = 0, dot = 0;
  for (i = 0; i < 10; i++) {
    cin >> str[i];
  }
  for (i = 0; i < 10; i++) {
    for (j = 0; j + 4 < 10; j++) {
      for (k = j; k < j + 5; k++) {
        if (str[i][k] == 'X') crosses++;
        if (str[i][k] == '.') dot++;
      }
      if (crosses == 4 && dot == 1) {
        cout << "YES" << endl;
        return 0;
      }
      if (crosses == 5) {
        cout << "YES" << endl;
        return 0;
      }
      crosses = 0;
      dot = 0;
    }
  }
  for (j = 0; j < 10; j++) {
    for (i = 0; i + 4 < 10; i++) {
      for (k = i; k < i + 5; k++) {
        if (str[k][j] == 'X') crosses++;
        if (str[k][j] == '.') dot++;
      }
      if (crosses == 4 && dot == 1) {
        cout << "YES" << endl;
        return 0;
      }
      if (crosses == 5) {
        cout << "YES" << endl;
        return 0;
      }
      crosses = 0;
      dot = 0;
    }
  }
  for (i = 0; i < 10; i++) {
    for (j = 0; j < 10; j++) {
      l = j;
      if (l + 4 < 10)
        if (i + 4 < 10)
          for (k = i; k < i + 5; k++) {
            if (str[k][l] == 'X') crosses++;
            if (str[k][l] == '.') dot++;
            l++;
          }
      if (crosses == 4 && dot == 1) {
        cout << "YES" << endl;
        return 0;
      }
      if (crosses == 5) {
        cout << "YES" << endl;
        return 0;
      }
      crosses = 0;
      dot = 0;
    }
  }
  for (i = 0; i < 10; i++) {
    for (j = 0; j < 10; j++) {
      l = j;
      if (l - 4 >= 0)
        if (i + 4 < 10)
          for (k = i; k < i + 5; k++) {
            if (str[k][l] == 'X') crosses++;
            if (str[k][l] == '.') dot++;
            l--;
          }
      if (crosses == 4 && dot == 1) {
        cout << "YES" << endl;
        return 0;
      }
      if (crosses == 5) {
        cout << "YES" << endl;
        return 0;
      }
      crosses = 0;
      dot = 0;
    }
  }
  cout << "NO" << endl;
  return 0;
}
