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