#include <bits/stdc++.h>
using namespace std;
inline long long re() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
int main() {
  int n = re();
  string s;
  cin >> s;
  int num = 0;
  int ed;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == '8') {
      num++;
      ed = i;
    }
  }
  int e = (n - 11) / 2;
  if (num <= e)
    puts("NO");
  else {
    int cnt = 0;
    int rr = 0;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == '8') {
        cnt++;
        if (cnt == e + 1) {
          if (rr <= e) {
            puts("YES");
          } else
            puts("NO");
          return 0;
        }
      } else
        rr++;
    }
  }
}
