#include <bits/stdc++.h>
using namespace std;
const int n = 10;
vector<string> v(n);
bool check() {
  for (int i = 0; i < n; ++i) {
    for (int k = 0; k < 6; ++k) {
      bool is = false;
      for (int j = 0; j < 5; ++j) {
        if (v[i][j + k] != 'X') {
          is = true;
        }
      }
      if (!is) {
        return true;
      }
    }
  }
  for (int i = 0; i < n; ++i) {
    for (int k = 0; k < 6; ++k) {
      bool is = false;
      for (int j = 0; j < 5; ++j) {
        if (v[j + k][i] != 'X') {
          is = true;
        }
      }
      if (!is) {
        return true;
      }
    }
  }
  for (int i = 0; i < 6; ++i) {
    for (int j = 0; j < 6; ++j) {
      bool is = false;
      for (int k = 0; k < 5; ++k) {
        if (v[i + k][j + k] != 'X') {
          is = true;
        }
      }
      if (!is) {
        return true;
      }
    }
  }
  for (int i = 0; i < 6; ++i) {
    for (int j = 4; j < 10; ++j) {
      bool is = false;
      for (int k = 0; k < 5; ++k) {
        if (v[i + k][j - k] != 'X') {
          is = true;
        }
      }
      if (!is) {
        return true;
      }
    }
  }
  return false;
}
int main(void) {
  for (int i = 0; i < n; ++i) {
    cin >> v[i];
  }
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      if (v[i][j] == '.') {
        v[i][j] = 'X';
        if (check()) {
          cout << "YES" << endl;
          return 0;
        }
        v[i][j] = '.';
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
