#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
char s[11][11];
bool judge(int i, int j) {
  int count = 0, ii = i, jj = j;
  while (ii >= 0 && s[ii][j] == 'X') count++, ii--;
  ii = i + 1;
  while (ii < 10 && s[ii][j] == 'X') count++, ii++;
  if (count >= 5) return 1;
  count = 0;
  while (jj >= 0 && s[i][jj] == 'X') count++, jj--;
  jj = j + 1;
  while (jj < 10 && s[i][jj] == 'X') count++, jj++;
  if (count >= 5) return 1;
  ii = i, jj = j, count = 0;
  while (ii >= 0 && jj >= 0 && s[ii][jj] == 'X') count++, ii--, jj--;
  ii = i + 1, jj = j + 1;
  while (ii < 10 && jj < 10 && s[ii][jj] == 'X') count++, ii++, jj++;
  if (count >= 5) return 1;
  ii = i, jj = j, count = 0;
  while (ii >= 0 && jj < 10 && s[ii][jj] == 'X') count++, ii--, jj++;
  ii = i + 1, jj = j - 1;
  while (ii < 10 && jj >= 0 && s[ii][jj] == 'X') count++, ii++, jj--;
  return count >= 5;
}
int main() {
  bool flag = 0;
  for (int i = 0; i < 10; i++) scanf("%s", s[i]);
  for (int i = 0; i < 10; i++)
    for (int j = 0; j < 10; j++)
      if (s[i][j] == '.') {
        s[i][j] = 'X';
        if (judge(i, j)) {
          flag = 1;
          break;
        }
        s[i][j] = '.';
      }
  if (!flag) {
    for (int i = 0; i < 10; i++)
      for (int j = 0; j < 10; j++)
        if (s[i][j] == 'X' && judge(i, j)) {
          flag = 1;
          break;
        }
  }
  puts(flag ? "YES" : "NO");
  return 0;
}
