#include <bits/stdc++.h>
using namespace std;
long long a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w,
    x, y, z;
long long ans = 0, sum = 0, mn = 1e18, mx = 0, cnt = 0;
const long long M = 1000000007;
map<int, int> mp;
map<int, int> mp2;
vector<int> vec;
vector<int> vec2;
vector<int> res;
char arr[10][10];
int dots = 0;
int xy(int ii, int jj) {
  cnt = 0;
  if (jj + 4 < 10)
    for (int i = 0; i < 5; i++) {
      if (arr[ii][jj + i] == 'X') cnt++;
      if (arr[ii][jj + i] == '.') dots++;
    }
  if (cnt == 5 || (cnt == 4 && dots == 1)) return 1;
  cnt = 0;
  dots = 0;
  if (jj - 4 >= 0)
    for (int i = 0; i < 5; i++) {
      if (arr[ii][jj - i] == 'X') cnt++;
      if (arr[ii][jj - i] == '.') dots++;
    }
  if (cnt == 5 || (cnt == 4 && dots == 1)) return 1;
  cnt = 0;
  dots = 0;
  if (ii + 4 < 10)
    for (int i = 0; i < 5; i++) {
      if (arr[ii + i][jj] == 'X') cnt++;
      if (arr[ii + i][jj] == '.') dots++;
    }
  if (cnt == 5 || (cnt == 4 && dots == 1)) return 1;
  cnt = 0;
  dots = 0;
  if (ii - 4 >= 0)
    for (int i = 0; i < 5; i++) {
      if (arr[ii - i][jj] == 'X') cnt++;
      if (arr[ii - i][jj] == '.') dots++;
    }
  if (cnt == 5 || (cnt == 4 && dots == 1)) return 1;
  return 0;
}
int diagonal(int ii, int jj) {
  cnt = 0;
  dots = 0;
  if (ii + 4 < 10 && jj + 4 < 10)
    for (int i = 0; i < 5; i++) {
      if (arr[ii + i][jj + i] == 'X') cnt++;
      if (arr[ii + i][jj + i] == '.') dots++;
    }
  if (cnt == 5 || (cnt == 4 && dots == 1)) return 1;
  cnt = 0;
  dots = 0;
  if (ii - 4 >= 0 && jj - 4 >= 0)
    for (int i = 0; i < 5; i++) {
      if (arr[ii - i][jj - i] == 'X') cnt++;
      if (arr[ii - i][jj - i] == '.') dots++;
    }
  if (cnt == 5 || (cnt == 4 && dots == 1)) return 1;
  cnt = 0;
  dots = 0;
  if (ii - 4 >= 0 && jj + 4 < 10)
    for (int i = 0; i < 5; i++) {
      if (arr[ii - i][jj + i] == 'X') cnt++;
      if (arr[ii - i][jj + i] == '.') dots++;
    }
  if (cnt == 5 || (cnt == 4 && dots == 1)) return 1;
  cnt = 0;
  dots = 0;
  if (ii + 4 < 10 && jj - 4 >= 0)
    for (int i = 0; i < 5; i++) {
      if (arr[ii + i][jj - i] == 'X') cnt++;
      if (arr[ii + i][jj - i] == '.') dots++;
    }
  if (cnt == 5 || (cnt == 4 && dots == 1)) return 1;
  return 0;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
int main() {
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      cin >> arr[i][j];
    }
  }
  bool flag = false;
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      if (xy(i, j) != 0 || diagonal(i, j) != 0) flag = true;
    }
    if (flag) break;
  }
  if (flag)
    puts("YES");
  else
    puts("NO");
  return 0;
}
