#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string k;
  cin >> n >> k;
  int inp = (n - 1) / 2;
  int moves = (inp - 5);
  int eights = 0;
  int laste;
  int toint;
  for (int i = 0; i < n; i++) {
    toint = (k[i] - '0');
    if (toint == 8) {
      eights++;
      if (eights == moves + 1) {
        laste = i;
      }
    }
  }
  if (eights <= moves) {
    cout << "NO" << endl;
    return 0;
  }
  int prev = 0;
  for (int i = 0; i < laste; i++) {
    toint = (int)(k[i] - '0');
    if (toint != 8) {
      prev++;
    }
  }
  if (prev > moves) {
    cout << "NO" << endl;
    return 0;
  }
  cout << "YES" << endl;
  return 0;
}
