#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  int cnt = 0;
  cin >> n >> s;
  int k = (n - 11) / 2;
  int hati = 0;
  for (int i = 0; cnt <= k && i < n; i++) {
    if (s[i] == '8')
      hati++;
    else
      cnt++;
  }
  if (hati >= k + 1) {
    cout << "YES" << endl;
  } else
    cout << "NO" << endl;
}
