#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n;
  cin >> n;
  string s;
  cin >> s;
  string res = "";
  long long int c1 = (n - 11) / 2;
  long long int c2 = c1;
  for (long long int i = 0; i < n; i++) {
    if (s[i] == '8') {
      if (c1 > 0)
        c1--;
      else
        res += s[i];
    } else {
      if (c2 > 0)
        c2--;
      else
        res += s[i];
    }
  }
  if (res[0] == '8') {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
