#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const long long inf = 1e18;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  string st;
  cin >> n >> st;
  long long rem8 = (n - 11) / 2;
  long long oth = n - 11 - (n - 11) / 2;
  for (long long i = 0; i < st.size(); i++) {
    if (st[i] == '8' && rem8 == 0 && oth >= 0) {
      cout << "YES";
      return 0;
    }
    if (st[i] == '8' && rem8 > 0)
      rem8--;
    else
      oth--;
  }
  cout << "NO";
}
