#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {}
long long t, d, n, m, q, k;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(20);
  long long TestCases = 1;
  while (TestCases--) {
    string s;
    cin >> n >> s;
    long long p = (n - 11) / 2;
    vector<long long> v;
    q = 0;
    for (long long i = (0); i < (n); ++(i))
      if (s[i] == '8') ++q, v.push_back(i);
    if (q <= p) {
      cout << "NO";
      return 0;
    }
    {
      string _s = "v[p]";
      replace(_s.begin(), _s.end(), ',', ' ');
      stringstream _ss(_s);
      istream_iterator<string> _it(_ss);
      err(_it, v[p]);
    };
    if (v[p] <= 2 * p)
      cout << "YES";
    else
      cout << "NO";
  }
  return 0;
}
