#include <bits/stdc++.h>
using namespace std;
int main() {
  int_fast64_t n;
  cin >> n;
  string s;
  cin >> s;
  list<char> l(begin(s), end(s));
  int_fast64_t turns = n - 11;
  int_fast64_t petya_turns = turns / 2;
  for (auto j = begin(l); j != end(l) && petya_turns;) {
    if (*j == '8') {
      j = l.erase(j);
      --petya_turns;
    } else {
      ++j;
    }
  }
  if (petya_turns) {
    cout << "NO" << endl;
    return 0;
  }
  int_fast64_t vasya_turns = turns / 2 + turns % 2;
  for (auto j = begin(l); j != end(l) && vasya_turns;) {
    if (*j == '8') {
      ++j;
    } else {
      j = l.erase(j);
      --vasya_turns;
    }
  }
  for (; vasya_turns; --vasya_turns) {
    l.erase(--end(l));
  }
  assert(l.size() == 11);
  if (*l.begin() == '8') {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
