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