#include <bits/stdc++.h>
using namespace std;
const char nl = '\n';
const int INF = 0x3f3f3f3f;
const long long INFLL = 0x3f3f3f3f3f3f3f3f;
const long long MOD = 1e9 + 7;
const long double EPS = 1e-10;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(10);
  int n;
  cin >> n;
  string s;
  cin >> s;
  int eight = 0;
  int other = 0;
  for (int i = 0; i <= n - 11; i++) {
    if (s[i] == '8') {
      eight++;
    } else {
      other++;
    }
  }
  if (eight > other) {
    cout << "YES" << nl;
  } else {
    cout << "NO" << nl;
  }
  return 0;
}
