import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.string;


void main() {
    auto N = readln.chomp.to!int;
    auto S = readln.chomp;
    auto used = new bool[](N);

    for (int i = 0, j = 0, t = 0, rest = N; rest > 11; t ^= 1, --rest) {
        if (t == 0) {
            while (i < N && (used[i] || S[i] == '8')) ++i;
            if (i >= N) {
                writeln("YES");
                return;
            }
            used[i] = true;
        } else {
            while (j < N && (used[j] || S[j] != '8')) ++j;
            if (j >= N) {
                writeln("NO");
                return;
            }
            used[j] = true;
        }
    }

    foreach (i; 0..N) {
        if (!used[i]) {
            writeln(S[i] == '8' ? "YES" : "NO");
            return;
        }
    }
}