#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string m;
  cin >> m;
  int count = (n - 11);
  int turn = count / 2;
  int am = 0;
  for (int e = 0; e < count + 1; e++) {
    if (m[e] == '8') {
      am++;
    }
  }
  if (am > turn) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
  return 0;
}
