#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long int n;
  long long int i, j, cnt = 1;
  cin >> n;
  vector<char> v;
  char ch;
  while (cin >> ch) v.push_back(ch);
  long long int t = (n - 11) / 2;
  for (i = 0; i < v.size(); i++) {
    if (cnt <= t && v[i] != '8') {
      v.erase(v.begin() + i);
      i--;
      cnt++;
    }
  }
  cnt = 0;
  for (i = 0; i < n; i++) {
    if (v[i] != '8') break;
    cnt++;
  }
  if (cnt <= t)
    cout << "NO";
  else
    cout << "YES";
}
int main() {
  long long int t;
  solve();
}
