#include <bits/stdc++.h>
long long max(long long a, long long b) { return a > b ? a : b; }
long long min(long long a, long long b) { return a < b ? a : b; }
using namespace std;
const int maxn = 2e3 + 5;
int main() {
  char P[15][15];
  for (long long i = 0; i < 10; i++) scanf("%s", P[i]);
  int ans = 1, k = 0;
  bool bo = false;
  for (long long i = 0; i < 10; i++) {
    ans = 1;
    k = 0;
    bo = false;
    for (long long j = 0; j < 10; j++) {
      if (P[i][j] == 'X')
        k++;
      else if (P[i][j] == '.' && ans) {
        ans = 0;
        if (k == 0) bo = true;
        k++;
      } else if (P[i][j] == '.' && bo) {
        if (k > 1) bo = false;
      } else if (P[i][j] == '.') {
        ans = 0;
        k = 1;
        bo = true;
      } else {
        ans = 1;
        k = 0;
        bo = false;
      }
      if (k == 5) break;
    }
    if (k == 5) break;
  }
  if (k == 5) {
    cout << "YES" << endl;
    return 0;
  }
  ans = 1;
  k = 0;
  bo = false;
  for (long long j = 0; j < 10; j++) {
    ans = 1;
    k = 0;
    bo = false;
    for (long long i = 0; i < 10; i++) {
      if (P[i][j] == 'X')
        k++;
      else if (P[i][j] == '.' && ans) {
        ans = 0;
        if (k == 0) bo = true;
        k++;
      } else if (P[i][j] == '.' && bo) {
        if (k > 1) bo = false;
      } else if (P[i][j] == '.') {
        ans = 0;
        k = 1;
        bo = true;
      } else {
        ans = 1;
        k = 0;
        bo = false;
      }
      if (k == 5) break;
    }
    if (k == 5) break;
  }
  if (k == 5) {
    cout << "YES" << endl;
    return 0;
  }
  ans = 1;
  k = 0;
  bo = false;
  for (long long n = 0; n < 10; n++) {
    ans = 1;
    k = 0;
    bo = false;
    int m = 0;
    for (long long v = 0; v < 10 - n; v++) {
      int i = m + v, j = n + v;
      if (P[i][j] == 'X')
        k++;
      else if (P[i][j] == '.' && ans) {
        ans = 0;
        if (k == 0) bo = true;
        k++;
      } else if (P[i][j] == '.' && bo) {
        if (k > 1) bo = false;
      } else if (P[i][j] == '.') {
        ans = 0;
        k = 1;
        bo = true;
      } else {
        ans = 1;
        k = 0;
        bo = false;
      }
      if (k == 5) break;
    }
    if (k == 5) break;
    ans = 1;
    k = 0;
    bo = false;
    for (long long v = 0; v < n + 1; v++) {
      int i = m + v, j = n - v;
      if (P[i][j] == 'X')
        k++;
      else if (P[i][j] == '.' && ans) {
        ans = 0;
        if (k == 0) bo = true;
        k++;
      } else if (P[i][j] == '.' && bo) {
        if (k > 1) bo = false;
      } else if (P[i][j] == '.') {
        ans = 0;
        k = 1;
        bo = true;
      } else {
        ans = 1;
        k = 0;
        bo = false;
      }
      if (k == 5) break;
    }
    if (k == 5) break;
  }
  if (k == 5) {
    cout << "YES" << endl;
    return 0;
  }
  ans = 1;
  k = 0;
  bo = false;
  for (long long m = 0; m < 10; m++) {
    ans = 1;
    k = 0;
    bo = false;
    int n = 0;
    for (long long v = 0; v < m + 1; v++) {
      int i = m - v, j = v;
      if (P[i][j] == 'X')
        k++;
      else if (P[i][j] == '.' && ans) {
        ans = 0;
        if (k == 0) bo = true;
        k++;
      } else if (P[i][j] == '.' && bo) {
        if (k > 1) bo = false;
      } else if (P[i][j] == '.') {
        ans = 0;
        k = 1;
        bo = true;
      } else {
        ans = 1;
        k = 0;
        bo = false;
      }
      if (k == 5) break;
    }
    if (k == 5) break;
    ans = 1;
    k = 0;
    bo = false;
    for (long long v = 0; v < 10 - m; v++) {
      int i = m + v, j = v;
      if (P[i][j] == 'X')
        k++;
      else if (P[i][j] == '.' && ans) {
        ans = 0;
        if (k == 0) bo = true;
        k++;
      } else if (P[i][j] == '.' && bo) {
        if (k > 1) bo = false;
      } else if (P[i][j] == '.') {
        ans = 0;
        k = 1;
        bo = true;
      } else {
        ans = 1;
        k = 0;
        bo = false;
      }
      if (k == 5) break;
    }
    if (k == 5) break;
    ans = 1;
    k = 0;
    bo = false;
    n = 9;
    for (long long v = 0; v < 10 - m; v++) {
      int i = v + m, j = 9 - v;
      if (P[i][j] == 'X')
        k++;
      else if (P[i][j] == '.' && ans) {
        ans = 0;
        if (k == 0) bo = true;
        k++;
      } else if (P[i][j] == '.' && bo) {
        if (k > 1) bo = false;
      } else if (P[i][j] == '.') {
        ans = 0;
        k = 1;
        bo = true;
      } else {
        ans = 1;
        k = 0;
        bo = false;
      }
      if (k == 5) break;
    }
    if (k == 5) break;
  }
  if (k == 5)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
