#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    int n, f = 0;
    cin >> n;
    string s, p = "";
    cin >> s;
    int m = (n - 11) / 2, c = (n - 11) / 2;
    for (int i = 0; i < n; i++) {
      if (s[i] == '8') {
        if (m > 0) {
          m--;
        } else {
          p += s[i];
        }
      } else {
        p += s[i];
      }
    }
    s = p;
    p = "";
    for (int i = m; i < s.length(); i++) {
      p += s[i];
    }
    for (int i = 0; i <= c; i++) {
      if (p[i] == '8') {
        f = 1;
      }
    }
    if (f) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
      continue;
    };
  }
  return 0;
}
