#include <bits/stdc++.h>
using namespace std;
bool comp(pair<pair<int, int>, int> a, pair<pair<int, int>, int> b) {
  if (a.first.second == b.first.second) return (a.first.first < b.first.first);
  return a.first.second < b.first.second;
}
int main() {
  int n;
  string s;
  cin >> n;
  cin >> s;
  int k = n - 10;
  int k1 = 0;
  for (size_t i = 0; i < k; i++) {
    if (s[i] == '8') k1++;
  }
  if (k1 > k / 2)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
