#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  string grid[10];
  for (long i = 0; i < 10; ++i) cin >> grid[i];
  bool possible = false;
  for (long i = 0; i < 10 and !possible; ++i) {
    for (long j = 0; j < 10 and !possible; ++j) {
      if (grid[i][j] != '.') continue;
      long left = 0, right = 0, down = 0, up = 0, ld = 0, ru = 0, lu = 0,
           rd = 0;
      for (long k = j - 1; k >= 0 and grid[i][k] == 'X'; --k) ++left;
      for (long k = j + 1; k < 10 and grid[i][k] == 'X'; ++k) ++right;
      for (long k = i - 1; k >= 0 and grid[k][j] == 'X'; --k) ++down;
      for (long k = i + 1; k < 10 and grid[k][j] == 'X'; ++k) ++up;
      for (long k = -1; i + k >= 0 and j + k >= 0 and grid[i + k][j + k] == 'X';
           --k)
        ++ld;
      for (long k = 1; i + k < 10 and j + k < 10 and grid[i + k][j + k] == 'X';
           ++k)
        ++ru;
      for (long k = 1; i + k < 10 and j - k >= 0 and grid[i + k][j - k] == 'X';
           ++k)
        ++lu;
      for (long k = 1; i - k >= 0 and j + k < 10 and grid[i - k][j + k] == 'X';
           ++k)
        ++rd;
      if (left + right >= 4 or up + down >= 4 or ld + ru >= 4 or lu + rd >= 4)
        possible = true;
    }
  }
  if (possible)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
