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