#include <bits/stdc++.h>
using namespace std;
void solve();
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  solve();
}
template <typename Type>
void print_collection(Type coll) {
  cout << "{ ";
  for (auto e : coll) cout << e << ' ';
  cout << "}\n";
}
void solve() {
  int n;
  string s;
  cin >> n >> s;
  int total_moves = n - 11;
  int moves = total_moves / 2;
  stack<int> a;
  for (int i = n - 1; i >= 0; --i) {
    if (s[i] == '8') a.push(i);
  }
  for (int i = 0; i < moves and !a.empty(); ++i, a.pop())
    ;
  if (!a.empty() and a.top() <= 2 * moves)
    cout << "YES\n";
  else
    cout << "NO\n";
  return;
}
