#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << '\n';
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
bool cmpManh(const std::pair<long long, long long>& l,
             const std::pair<long long, long long>& r) {
  return ((llabs(l.first) + llabs(l.second)) <
          (llabs(r.first) + llabs(r.second)));
}
int gcd(int a, int b) {
  if (a == 0) return b;
  return gcd(b % a, a);
}
int main(void) {
  char a[10][10], b[10][10];
  for (int i = 0; i < 10; ++i) {
    for (int j = 0; j < 10; ++j) {
      cin >> a[i][j];
    }
  }
  for (int i = 0; i < 10; ++i) {
    for (int k = 0; k <= 5; ++k) {
      int cnt = 0;
      int o = 0;
      for (int j = k; j < k + 5; ++j) {
        if (a[i][j] == 'X') cnt++;
        if (a[i][j] == 'O') o++;
      }
      if (cnt == 4 && o == 0) {
        cout << "YES" << '\n';
        return 0;
      }
      if (cnt == 5) {
        cout << "YES" << '\n';
        return 0;
      }
    }
  }
  for (int i = 0; i < 10; ++i) {
    for (int j = 0; j < 10; ++j) {
      b[i][j] = a[i][9 - j];
    }
  }
  for (int j = 0; j < 10; ++j) {
    for (int k = 0; k <= 5; ++k) {
      int cnt = 0;
      int o = 0;
      for (int i = k; i < k + 5; ++i) {
        if (a[i][j] == 'X') cnt++;
        if (a[i][j] == 'O') o++;
      }
      if (cnt == 4 && o == 0) {
        cout << "YES" << '\n';
        return 0;
      }
      if (cnt == 5) {
        cout << "YES" << '\n';
        return 0;
      }
    }
  }
  for (int i = 0; i < 10; ++i) {
    for (int k = 0; k <= 5 - i; ++k) {
      int cnt = 0;
      int o = 0;
      for (int j = k; j < k + 5; ++j) {
        if (a[j + i][j] == 'X') cnt++;
        if (a[j + i][j] == 'O') o++;
      }
      if (cnt == 4 && o == 0) {
        cout << "YES" << '\n';
        return 0;
      }
      if (cnt == 5) {
        cout << "YES" << '\n';
        return 0;
      }
    }
  }
  for (int i = 0; i < 10; ++i) {
    for (int k = 0; k <= 5 - i; ++k) {
      int cnt = 0;
      int o = 0;
      for (int j = k; j < k + 5; ++j) {
        if (a[j + i][j] == 'X') cnt++;
        if (a[j + i][j] == 'O') o++;
      }
      if (cnt == 4 && o == 0) {
        cout << "YES" << '\n';
        return 0;
      }
      if (cnt == 5) {
        cout << "YES" << '\n';
        return 0;
      }
      cnt = 0;
      o = 0;
      for (int j = k; j < k + 5; ++j) {
        if (a[j][j + i] == 'X') cnt++;
        if (a[j][j + i] == 'O') o++;
      }
      if (cnt == 4 && o == 0) {
        cout << "YES" << '\n';
        return 0;
      }
      if (cnt == 5) {
        cout << "YES" << '\n';
        return 0;
      }
    }
  }
  for (int i = 0; i < 10; ++i) {
    for (int k = 0; k <= 5 - i; ++k) {
      int cnt = 0;
      int o = 0;
      for (int j = k; j < k + 5; ++j) {
        if (b[j + i][j] == 'X') cnt++;
        if (b[j + i][j] == 'O') o++;
      }
      if (cnt == 4 && o == 0) {
        cout << "YES" << '\n';
        return 0;
      }
      if (cnt == 5) {
        cout << "YES" << '\n';
        return 0;
      }
      cnt = 0;
      o = 0;
      for (int j = k; j < k + 5; ++j) {
        if (b[j][j + i] == 'X') cnt++;
        if (b[j][j + i] == 'O') o++;
      }
      if (cnt == 4 && o == 0) {
        cout << "YES" << '\n';
        return 0;
      }
      if (cnt == 5) {
        cout << "YES" << '\n';
        return 0;
      }
    }
  }
  cout << "NO" << '\n';
  return (0);
}
