#include <bits/stdc++.h>
using namespace std;
long long const mod = 1073741824;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long t, n, i, j, k, cnt = 0, sum1 = 0, ccnt = 0, x = 0, m, y = 0, z, x1,
                           y1 = 0, z1, total = 0, sum = 0, x2, y2;
  cin >> n;
  string s;
  cin >> s;
  x = (n - 11) / 2;
  for (i = 0; i < n; i++) {
    if (s[i] != '8') {
      s[i] = 'b';
      x--;
    }
    if (x == 0) {
      break;
    }
  }
  x = (n - 11) / 2;
  vector<char> a, b;
  for (i = 0; i < n; i++) {
    if (s[i] != 'b') {
      a.push_back(s[i]);
    }
  }
  for (i = 0; i < a.size(); i++) {
    if (a[i] == '8') {
      a[i] = 'b';
      x--;
    }
    if (x == 0) break;
  }
  for (i = 0; i < a.size(); i++) {
    if (a[i] != 'b') {
      b.push_back(a[i]);
    }
  }
  if (b.size() >= 11 && b[0] == '8') {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}
