#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
char a[N];
int a8[N];
int main() {
  int i, n, j, l, sum1 = 0, sum2 = 0;
  scanf("%d", &n);
  char m[n + 10];
  scanf("%s", m);
  for (i = 0; i < n - 10; i++) {
    if (m[i] == '8')
      sum1++;
    else
      sum2++;
  }
  if (sum2 <= sum1)
    printf("YES\n");
  else
    printf("NO\n");
  return 0;
}
