#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
const long long int M = 1e9 + 7;
const long double PI = 3.14159265;
using namespace std;
void solve() {
  long long int n, i, x, c = 0;
  string str;
  cin >> n >> str;
  for (i = 0; i <= n - 11; i++) {
    if (str[i] == '8')
      c++;
    else
      c--;
  }
  if (c > 0)
    cout << "YES";
  else
    cout << "NO";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t;
  t = 1;
  while (t--) {
    solve();
  }
}
