#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<vector<char> > m(10, vector<char>(10, 0));
  for (int i = 0; i < 10; i++)
    for (int j = 0; j < 10; j++) cin >> m[i][j];
  for (int i = 0; i < 10; i++) {
    int left = 0;
    int right = 0;
    bool point = false;
    for (int j = 0; j < 10; j++) {
      char c = m[i][j];
      if (c == 'X') {
        if (point)
          right++;
        else
          left++;
        if ((left + right) == 4 && point) {
          cout << "YES" << endl;
          return 0;
        }
      } else if (c == '.') {
        if ((left + right) == 4) {
          cout << "YES" << endl;
          return 0;
        }
        if (point) {
          left = right;
          right = 0;
        }
        point = true;
      } else {
        left = 0;
        right = 0;
        point = false;
      }
    }
  }
  for (int j = 0; j < 10; j++) {
    int left = 0;
    int right = 0;
    bool point = false;
    for (int i = 0; i < 10; i++) {
      char c = m[i][j];
      if (c == 'X') {
        if (point)
          right++;
        else
          left++;
        if ((left + right) == 4 && point) {
          cout << "YES" << endl;
          return 0;
        }
      } else if (c == '.') {
        if ((left + right) == 4) {
          cout << "YES" << endl;
          return 0;
        }
        if (point) {
          left = right;
          right = 0;
        }
        point = true;
      } else {
        left = 0;
        right = 0;
        point = false;
      }
    }
  }
  for (int i = 0; i < 10; i++) {
    int left = 0;
    int right = 0;
    bool point = false;
    for (int j = 0; j < 10 - i; j++) {
      char c = m[i + j][j];
      if (c == 'X') {
        if (point)
          right++;
        else
          left++;
        if ((left + right) == 4 && point) {
          cout << "YES" << endl;
          return 0;
        }
      } else if (c == '.') {
        if ((left + right) == 4) {
          cout << "YES" << endl;
          return 0;
        }
        if (point) {
          left = right;
          right = 0;
        }
        point = true;
      } else {
        left = 0;
        right = 0;
        point = false;
      }
    }
  }
  for (int j = 0; j < 10; j++) {
    int left = 0;
    int right = 0;
    bool point = false;
    for (int i = 0; i < 10 - j; i++) {
      char c = m[i][j + i];
      if (c == 'X') {
        if (point)
          right++;
        else
          left++;
        if ((left + right) == 4 && point) {
          cout << "YES" << endl;
          return 0;
        }
      } else if (c == '.') {
        if ((left + right) == 4) {
          cout << "YES" << endl;
          return 0;
        }
        if (point) {
          left = right;
          right = 0;
        }
        point = true;
      } else {
        left = 0;
        right = 0;
        point = false;
      }
    }
  }
  for (int i = 9; i >= 0; i--) {
    int left = 0;
    int right = 0;
    bool point = false;
    for (int j = 0; j <= i; j++) {
      char c = m[i - j][j];
      if (c == 'X') {
        if (point)
          right++;
        else
          left++;
        if ((left + right) == 4 && point) {
          cout << "YES" << endl;
          return 0;
        }
      } else if (c == '.') {
        if ((left + right) == 4) {
          cout << "YES" << endl;
          return 0;
        }
        if (point) {
          left = right;
          right = 0;
        }
        point = true;
      } else {
        left = 0;
        right = 0;
        point = false;
      }
    }
  }
  for (int j = 0; j <= 9; j++) {
    int left = 0;
    int right = 0;
    bool point = false;
    for (int i = 9; i >= j; i--) {
      char c = m[i][9 + j - i];
      if (c == 'X') {
        if (point)
          right++;
        else
          left++;
        if ((left + right) == 4 && point) {
          cout << "YES" << endl;
          return 0;
        }
      } else if (c == '.') {
        if ((left + right) == 4) {
          cout << "YES" << endl;
          return 0;
        }
        if (point) {
          left = right;
          right = 0;
        }
        point = true;
      } else {
        left = 0;
        right = 0;
        point = false;
      }
    }
  }
  cout << "NO" << endl;
  return 0;
}
