#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int N = 300005;
int main() {
  int n;
  char s[N];
  scanf("%d", &n);
  scanf("%s", s);
  int qtd = 0;
  int mv2 = (n - 11) / 2;
  int mv1 = (n - 11) - mv2;
  for (int i = 0; i < n; i++) {
    if (mv2 && s[i] == '8') {
      mv2--;
      s[i] = 'a';
    }
  }
  for (int i = 0; i < n; i++) {
    if (s[i] == 'a') continue;
    if (s[i] == '8') {
      printf("YES\n");
      return 0;
    } else {
      mv1--;
    }
    if (mv1 < 0) {
      printf("NO\n");
      return 0;
    }
  }
  printf("NO\n");
  return 0;
}
