#include <bits/stdc++.h>
using namespace std;
int n, p1, p2;
int vis[300005];
char s[300005];
int main() {
  scanf("%d", &n);
  scanf("%s", s + 1);
  p1 = 1, p2 = 1;
  for (int i = 1; i <= n - 11; i++) {
    if (i & 1) {
      while ((s[p1] == '8' && p1 <= n) || vis[p1]) p1++;
      vis[p1] = 1;
    } else {
      while ((s[p2] != '8' && p2 <= n) || vis[p2]) p2++;
      if (s[p2] == '8' && !vis[p2]) vis[p2] = 1;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (!vis[i]) {
      if (s[i] == '8') {
        puts("YES");
      } else
        puts("NO");
      return 0;
    }
  }
  return 0;
}
