#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, e8 = 0, els = 0;
  string s;
  cin >> n >> s;
  vector<int> p8;
  for (int i = 0; i < n; i++) {
    if (s[i] == '8') {
      e8++;
      p8.push_back(i);
    } else
      els++;
  }
  int rem = n - 11;
  if (rem / 2 >= e8 || p8[rem / 2] > rem)
    cout << "NO";
  else
    cout << "YES";
  return 0;
}
