
n = int(input())
houses = [int(x) for x in input().split(" ")]
ret = n * [None]

def normalize(a):
    s = sorted(a.copy())
    return [s.index(x) for x in a]


h_normalized = normalize(houses)

for i, h in enumerate(h_normalized):

    higher = n - h - 1
    lower = h
    needed_h_pop = max(0, higher - lower)
    needed_l_pop = max(0, - higher + lower)

    if n - max(needed_h_pop, needed_l_pop) < 3:
        ret[i] = False
        # print("extrem")
        continue

    ok = False

    ilmax = i - 1
    irmin = i + 1

    target_gain = max(needed_h_pop, needed_l_pop)
    # print(f"\t{target_gain = }")
    if target_gain == 0:
        ret[i] = True
        continue
    step = 1 if needed_h_pop > needed_l_pop else -1

    lgain = 0
    lgainmax = 0
    lgainmax_edge = [None] * 3
    for ili in range(ilmax + 1):
        is_higher = 1 if h_normalized[ili] > h else -1
        lgain += is_higher * step
        # print(f"\t{lgain = } {is_higher = } {step = }")
        lgainmax = max(lgainmax, lgain)
        fromh = ilmax - ili
        if fromh < 3:
            lgainmax_edge[fromh] = lgainmax
        if fromh >= 2 and lgainmax >= target_gain:
            ok = True
            break

    if ok:
        ret[i] = ok
        # print("ok zleva")
        continue

    rgain = 0
    rgainmax = 0
    rgainmax_edge = [None] * 3
    for iri in reversed(range(irmin, n)):
        is_higher = 1 if h_normalized[iri] > h else -1
        rgain += is_higher * step
        rgainmax = max(rgainmax, rgain)
        fromh = iri - irmin
        # print(f"\t{rgain = } {is_higher = } {step = } {fromh = }")
        if fromh < 3:
            rgainmax_edge[fromh] = rgainmax
        if fromh >= 2 and rgainmax >= target_gain:
            ok = True
            break

    if ok:
        ret[i] = ok
        # print("ok zprava")
        continue

    # print(f"\t{lgainmax_edge = }")
    # print(f"\t{rgainmax_edge = }")
    for shift in range(3):
        max_edge_shift_gains = (rgainmax_edge[shift], lgainmax_edge[2 - shift])
        # print(f"\t{max_edge_shift_gains = }")
        if None in max_edge_shift_gains:
            continue
        if sum(max_edge_shift_gains) >= target_gain:
            ok = True
            break

    ret[i] = ok
    # print(f"{ok} shift")

print(" ".join(["YES" if x else "NO" for x in ret]))
