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