#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int n, eight = 0;
  char s[100010];
  cin >> n;
  cin >> s;
  for (int i = 0; i < n - 10; i++) {
    if (s[i] == '8') eight++;
  }
  if (2 * eight > (n - 10))
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}
