#include <bits/stdc++.h>
using namespace std;
const int MX = 5002;
string grid[100];
int dx[8] = {1, -1, 0, 0, 1, 1, -1, -1};
int dy[8] = {0, 0, 1, -1, 1, -1, 1, -1};
int main() {
  int n = 10;
  int ans = 0;
  for (int j = 0; j < n; j++) cin >> grid[j];
  for (int j = 0; j < 10; j++) {
    for (int i = 0; i < 10; i++) {
      for (int d = 0; d < 8; d++) {
        int x = j, y = i;
        int len = 0, fakss = 0;
        while (1) {
          if (x < 0 || y < 0 || x >= n || y >= n) break;
          if (grid[x][y] == 'O') break;
          if (grid[x][y] == '.') {
            if (fakss) break;
            fakss = 1;
          }
          ++len;
          x += dx[d], y += dy[d];
        }
        ans = max(ans, len);
      }
    }
  }
  if (ans >= 5)
    puts("YES");
  else
    puts("NO");
}
