#include <bits/stdc++.h>
using namespace std;
vector<pair<long long, long long>> vp;
int main() {
  long long n;
  cin >> n;
  set<long long> st;
  string s;
  cin >> s;
  long long i;
  long long sl = s.length();
  queue<long long> q1, q2;
  for (i = 0; i < n; i++) {
    if (s[i] - '0' == 8) {
      q1.push(i);
    } else {
      q2.push(i);
    }
  }
  while ((q1.size() + q2.size()) != 11) {
    if (q2.size() == 0) {
      cout << "YES" << endl;
      return 0;
    } else {
      long long boss = q2.front();
      q2.pop();
    }
    if (q1.size() == 0) {
      cout << "NO" << endl;
      return 0;
    } else {
      long long boss = q1.front();
      q1.pop();
    }
  }
  if (q1.size() == 0) {
    cout << "NO" << endl;
    return 0;
  }
  if (q1.front() < q2.front() || q2.size() == 0) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
