#include <bits/stdc++.h>
using namespace std;
int main() {
  int Sz;
  cin >> Sz;
  int Cnt = (Sz - 11) / 2 + (Sz - 11) % 2;
  string S1;
  cin >> S1;
  for (int K = 0; Cnt > 0; K++) {
    if (S1[K] != '8' && Cnt > 0) {
      S1.erase(K, 1);
      Cnt = Cnt - 1;
      K = K - 1;
    }
  }
  int Cnt2 = 0;
  for (int K = 0; S1[K] == '8'; K++) Cnt2++;
  if ((Sz - 11) / 2 < Cnt2)
    cout << "YES";
  else
    cout << "NO";
  return 0;
}
