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