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