#include <bits/stdc++.h>
using namespace std;
int main() {
  char C[10][10];
  bool B[10][10];
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      cin >> C[i][j];
    }
  }
  for (int i = 4; i < 10; i++) {
    for (int j = 4; j < 10; j++) {
      bool use = false;
      if (C[i][j] == '.') {
        use = true;
      }
      if (C[i][j] == 'X' || use) {
        bool fin = false;
        for (int ii = 1; ii < 5 && !fin; ii++) {
          if (C[i - ii][j - ii] == '.') {
            if (use)
              fin = true;
            else
              use = true;
          } else if (C[i - ii][j - ii] == 'O') {
            fin = true;
          }
        }
        if (!fin) {
          cout << "YES" << endl;
          return 0;
        }
      }
    }
  }
  for (int i = 4; i < 10; i++) {
    for (int j = 0; j < 6; j++) {
      bool use = false;
      if (C[i][j] == '.') {
        use = true;
      }
      if (C[i][j] == 'X' || use) {
        bool fin = false;
        for (int ii = 1; ii < 5 && !fin; ii++) {
          if (C[i - ii][j + ii] == '.') {
            if (use)
              fin = true;
            else
              use = true;
          } else if (C[i - ii][j + ii] == 'O') {
            fin = true;
          }
        }
        if (!fin) {
          cout << "YES" << endl;
          return 0;
        }
      }
    }
  }
  for (int i = 4; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      bool use = false;
      if (C[i][j] == '.') {
        use = true;
      }
      if (C[i][j] == 'X' || use) {
        bool fin = false;
        for (int ii = 1; ii < 5 && !fin; ii++) {
          if (C[i - ii][j] == '.') {
            if (use)
              fin = true;
            else
              use = true;
          } else if (C[i - ii][j] == 'O') {
            fin = true;
          }
        }
        if (!fin) {
          cout << "YES" << endl;
          return 0;
        }
      }
    }
  }
  for (int i = 0; i < 10; i++) {
    for (int j = 4; j < 10; j++) {
      bool use = false;
      if (C[i][j] == '.') {
        use = true;
      }
      if (C[i][j] == 'X' || use) {
        bool fin = false;
        for (int ii = 1; ii < 5 && !fin; ii++) {
          if (C[i][j - ii] == '.') {
            if (use)
              fin = true;
            else
              use = true;
          } else if (C[i][j - ii] == 'O') {
            fin = true;
          }
        }
        if (!fin) {
          cout << "YES" << endl;
          return 0;
        }
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
