#include <bits/stdc++.h>
using namespace std;
char a[12][12];
int main() {
  memset(a, 0, sizeof(a));
  for (int i = 0; i < 10; i++) scanf("%s", a[i]);
  bool flag1 = true, flag2 = true, flag3 = true, flag4 = true, flag = false;
  int ans1 = 0, ans2 = 0, ans3 = 0, ans4 = 0;
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      flag1 = true, flag2 = true, flag3 = true, flag4 = true;
      ans1 = 0, ans2 = 0, ans3 = 0, ans4 = 0;
      int res1 = 0, res2 = 0, res3 = 0, res4 = 0;
      if (a[i][j] == 'X') {
        for (int p = 1; p <= 4; p++) {
          if (a[i + p][j] == 'X')
            ans1++;
          else if (a[i + p][j] == 'O') {
            flag1 = false;
            break;
          } else if (a[i + p][j] == '.')
            res1++;
        }
        if (a[i - 1][j] == '.' && i && res1 == 0) {
          if (ans1 >= 3) flag1 = true;
          res1++;
        }
        for (int p = 1; p <= 4; p++) {
          if (a[i][j + p] == 'X')
            ans2++;
          else if (a[i][j + p] == 'O') {
            flag2 = false;
            break;
          } else if (a[i][j + p] == '.')
            res2++;
        }
        if (a[i][j - 1] == '.' && j && res2 == 0) {
          if (ans2 >= 3) flag2 = true;
          res2++;
        }
        for (int p = 1; p <= 4; p++) {
          if (a[i + p][j + p] == 'X')
            ans3++;
          else if (a[i + p][j + p] == 'O') {
            flag3 = false;
            break;
          } else if (a[i + p][j + p] == '.')
            res3++;
        }
        if (a[i - 1][j - 1] == '.' && i && j && res3 == 0) {
          if (ans3 >= 3) flag3 = true;
          res3++;
        }
        for (int p = 1; p <= 4; p++) {
          if (j - p < 0) break;
          if (a[i + p][j - p] == 'X')
            ans4++;
          else if (a[i + p][j - p] == 'O') {
            flag4 = false;
            break;
          } else if (a[i + p][j - p] == '.')
            res4++;
        }
        if (a[i - 1][j + 1] == '.' && i && res4 == 0) {
          if (ans4 >= 3) flag4 = true;
          res4++;
        }
        if (flag1 && ans1 >= 3 && res1 == 1 ||
            flag2 && ans2 >= 3 && res2 == 1 ||
            flag3 && ans3 >= 3 && res3 == 1 || flag4 && ans4 >= 3 && res4 == 1)
          flag = true;
      }
      if (flag) break;
    }
    if (flag) break;
  }
  if (flag)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
