import sys


def sol():
    # sys.stdin = open("./2629/input.txt")
    input = sys.stdin.readline
    weights_count = int(input())
    weights = list(map(int, input().split()))
    marbles_count = int(input())
    marbles = list(map(int, input().split()))
    all_weights = generate_all_weights(weights)
    for marble in marbles:
        if marble in all_weights:
            print("Y", end=" ")
        else:
            print("N", end=" ")


def generate_all_weights(weights: list) -> set:
    result = set()
    result.add(weights[0])
    for i in range(1, len(weights)):
        new_weight = weights[i]
        tmp = set(result)
        for weight in tmp:
            result.add(new_weight)
            result.add(new_weight + weight)
            result.add(abs(new_weight - weight))
    return result


def sol_original():
    # sys.stdin = open("./2629/input.txt")
    input = sys.stdin.readline
    weights_count = int(input())
    weights = list(map(int, input().split()))
    marbles_count = int(input())
    marbles = [0] + list(map(int, input().split()))
    total_weights = sum(weights)
    dp = [[False] * (total_weights + 1) for _ in range(weights_count + 1)]
    dijkstra(weights, dp, 0, 0)
    for i in range(1, marbles_count + 1):
        cur_marble = marbles[i]
        if cur_marble > total_weights or not dp[weights_count][cur_marble]:
            print("N", end=" ")
        else:
            print("Y", end=" ")


def dijkstra(
    weights: list,
    dp: list,
    cur_weights_idx: int,
    cur_total_weights: int,
):
    if (
        cur_weights_idx > len(weights)
        or cur_total_weights > sum(weights)
        or dp[cur_weights_idx][cur_total_weights]
    ):
        return
    dp[cur_weights_idx][cur_total_weights] = True
    if cur_weights_idx == len(weights):
        return
    dijkstra(weights, dp, cur_weights_idx + 1, cur_total_weights)
    dijkstra(
        weights, dp, cur_weights_idx + 1, cur_total_weights + weights[cur_weights_idx]
    )
    dijkstra(
        weights,
        dp,
        cur_weights_idx + 1,
        abs(cur_total_weights - weights[cur_weights_idx]),
    )


if __name__ == "__main__":
    sol()
    sol_original()
