#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, l, n, test_case, m, r;
  test_case = 1;
  while (test_case--) {
    cin >> n;
    string str;
    cin >> str;
    int rem = n - 11;
    rem /= 2;
    string ans = "";
    for (auto it : str) {
      if (it == '8' && rem) {
        rem--;
      } else {
        ans += it;
      }
    }
    rem = (n - 10) / 2;
    for (i = 0; i < rem + 1; i++) {
      if (ans[i] == '8') {
        cout << "YES\n";
        return 0;
      }
    }
    cout << "NO\n";
  }
  return 0;
}
