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