#include <bits/stdc++.h>
using namespace std;
const int dx[] = {0, 1, -1, -1}, dy[] = {1, 1, 1, 0};
int n;
char Map[20][20];
bool check() {
  for (int i = 1; i <= 10; ++i)
    for (int j = 1; j <= 10; ++j)
      if (Map[i][j] == 'X') {
        for (int k = 0; k < 4; ++k) {
          int xx = i, yy = j;
          bool flag = true;
          for (int l = 0; l < 4; ++l) {
            xx += dx[k], yy += dy[k];
            if (Map[xx][yy] != 'X') {
              flag = false;
              break;
            }
          }
          if (flag) return true;
        }
      }
  return false;
}
int main() {
  memset(Map, 'O', sizeof(Map));
  for (int i = 1; i <= 10; ++i) scanf("%s", Map[i] + 1);
  for (int i = 1; i <= 10; ++i)
    for (int j = 1; j <= 10; ++j)
      if (Map[i][j] == '.') {
        char c = Map[i][j];
        Map[i][j] = 'X';
        if (check()) {
          puts("YES");
          return 0;
        }
        Map[i][j] = c;
      }
  puts("NO");
  return 0;
}
