//prewritten code: https://github.com/antma/algo
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.traits;

void main() {
  auto n = readln.strip.to!int;
  auto s = readln.strip[0 .. n];
  auto psteps = (n - 11) >> 1;
  auto t = s[0 .. n - 10];
  int e;
  foreach (i; 0 .. t.length) {
    if (t[i] == '8') {
      ++e;
    }
  }
  writeln (e > psteps ? "YES" : "NO");
}

