#include <bits/stdc++.h>
using namespace std;
char a[111100];
int main() {
  int n;
  scanf("%d", &n);
  scanf("%s", a);
  int s = 0;
  for (int i = 0; i <= n - 11; i++) {
    if (a[i] == '8') s++;
  }
  int k = (n - 10) / 2 + 1;
  if (s >= k)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  return 0;
}
