#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int maxn = 300050;
int a[maxn];
int main() {
  int n, m, i, j, k, x, y, b, c;
  scanf("%d", &n);
  x = y = 0;
  k = (n - 11) / 2;
  b = c = -1;
  for (i = 0; i < n; i++) {
    scanf("%1d", &a[i]);
    if (a[i] == 8) {
      x++;
      if (x == k + 1) b = i;
    } else {
      y++;
      if (y == k + 1) c = i;
    }
  }
  if (b == -1 || b > n - 11)
    printf("NO\n");
  else
    printf("YES\n");
  return 0;
}
