#include <bits/stdc++.h>
using namespace std;
char s[300010];
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", s);
  int t = n - 11;
  int sum = 0;
  for (int i = 0; i <= t; i++) {
    if (s[i] == '8') sum++;
  }
  if (sum > t / 2) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
  return 0;
}
