class Tree:
    class Node:
        def __init__(self, n, left, right):
            self.left = left
            self.right = right
            self.n = n
            if left is not None:
                lt = {t + n for t in left.totals}
            else:
                lt = set()
            if right is not None:
                rt = right.totals
            else:
                rt = set()

            self.totals = lt | rt | {n}

        def find(self, total):
            return total in self.totals

        def __str__(self):
            cs = []
            if self.left is not None:
                cs.append(str(self.left))
            if self.right is not None:
                cs.append(str(self.right))

            return "{} -> ({})".format(self.n, ",".join(cs))


    def __init__(self, ns):
        self.top = self.build_nodes(sorted(ns))

    def has_subset(self, total):
        return self.top.find(total)

    def build_nodes(self, ns):
        if len(ns) == 0:
            return None

        left = self.build_nodes(ns[:-1])
        right = self.build_nodes(ns[:-1])
        node = self.Node(ns[-1], left, right)

        return node


def run_tree():
    _ = int(input())  # flake8: noqa
    ns = [int(i) for i in input().split()]

    tree = Tree(ns)
    _ = int(input())  # flake8: noqa

    for q in (int(j) for j in input().split()):
        if tree.has_subset(q):
            print("yes")
        else:
            print("no")



if __name__ == '__main__':
    run_tree()
 class Tree:
    class Node:
        def __init__(self, n, left, right):
            self.left = left
            self.right = right
            self.n = n
            if left is not None:
                lt = {t + n for t in left.totals}
            else:
                lt = set()
            if right is not None:
                rt = right.totals
            else:
                rt = set()

            self.totals = lt | rt | {n}

        def find(self, total):
            return total in self.totals

        def __str__(self):
            cs = []
            if self.left is not None:
                cs.append(str(self.left))
            if self.right is not None:
                cs.append(str(self.right))

            return "{} -> ({})".format(self.n, ",".join(cs))


    def __init__(self, ns):
        self.top = self.build_nodes(sorted(ns))

    def has_subset(self, total):
        return self.top.find(total)

    def build_nodes(self, ns):
        if len(ns) == 0:
            return None

        left = self.build_nodes(ns[:-1])
        right = self.build_nodes(ns[:-1])
        node = self.Node(ns[-1], left, right)

        return node Tree class Node:
        def __init__(self, n, left, right):
            self.left = left
            self.right = right
            self.n = n
            if left is not None:
                lt = {t + n for t in left.totals}
            else:
                lt = set()
            if right is not None:
                rt = right.totals
            else:
                rt = set()

            self.totals = lt | rt | {n}

        def find(self, total):
            return total in self.totals

        def __str__(self):
            cs = []
            if self.left is not None:
                cs.append(str(self.left))
            if self.right is not None:
                cs.append(str(self.right))

            return "{} -> ({})".format(self.n, ",".join(cs))


     Node def __init__(self, n, left, right):
            self.left = left
            self.right = right
            self.n = n
            if left is not None:
                lt = {t + n for t in left.totals}
            else:
                lt = set()
            if right is not None:
                rt = right.totals
            else:
                rt = set()

            self.totals = lt | rt | {n}

         __init__ self.left = left self.left self left left self.right = right self.right self right right self.n = n self.n self n n if left is not None:
                lt = {t + n for t in left.totals}
            else:
                lt = set()
             left is not None left None t + n for t in left.totals for t in left.totals t left.totals left totals for t in left.totals t + n t n lt = {t + n for t in left.totals} lt lt = set() lt set() set if right is not None:
                rt = right.totals
            else:
                rt = set()

             right is not None right None rt = right.totals rt right.totals right totals rt = set() rt set() set self.totals = lt | rt | {n} self.totals self totals lt | rt | {n} lt | rt lt rt {n} self self n n left left right right def find(self, total):
            return total in self.totals

         find return total in self.totals total in self.totals total self.totals self totals self self total total def __str__(self):
            cs = []
            if self.left is not None:
                cs.append(str(self.left))
            if self.right is not None:
                cs.append(str(self.right))

            return "{} -> ({})".format(self.n, ",".join(cs))


     __str__ cs = [] cs [] if self.left is not None:
                cs.append(str(self.left))
             self.left is not None self.left self left None cs.append(str(self.left)) cs.append cs append str(self.left) str self.left self left if self.right is not None:
                cs.append(str(self.right))

             self.right is not None self.right self right None cs.append(str(self.right)) cs.append cs append str(self.right) str self.right self right return "{} -> ({})".format(self.n, ",".join(cs)) "{} -> ({})".format(self.n, ",".join(cs)) "{} -> ({})".format "{} -> ({})" format self.n self n ",".join(cs) ",".join "," join cs self self def __init__(self, ns):
        self.top = self.build_nodes(sorted(ns))

     __init__ self.top = self.build_nodes(sorted(ns)) self.top self top self.build_nodes(sorted(ns)) self.build_nodes self build_nodes sorted(ns) sorted ns self self ns ns def has_subset(self, total):
        return self.top.find(total)

     has_subset return self.top.find(total) self.top.find(total) self.top.find self.top self top find total self self total total def build_nodes(self, ns):
        if len(ns) == 0:
            return None

        left = self.build_nodes(ns[:-1])
        right = self.build_nodes(ns[:-1])
        node = self.Node(ns[-1], left, right)

        return node build_nodes if len(ns) == 0:
            return None

         len(ns) == 0 len(ns) len ns 0 return None None left = self.build_nodes(ns[:-1]) left self.build_nodes(ns[:-1]) self.build_nodes self build_nodes ns[:-1] ns :-1 -1 right = self.build_nodes(ns[:-1]) right self.build_nodes(ns[:-1]) self.build_nodes self build_nodes ns[:-1] ns :-1 -1 node = self.Node(ns[-1], left, right) node self.Node(ns[-1], left, right) self.Node self Node ns[-1] ns -1 left right return node node self self ns ns def run_tree():
    _ = int(input())  # flake8: noqa
    ns = [int(i) for i in input().split()]

    tree = Tree(ns)
    _ = int(input())  # flake8: noqa

    for q in (int(j) for j in input().split()):
        if tree.has_subset(q):
            print("yes")
        else:
            print("no") run_tree _ = int(input()) _ int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i ns = [int(i) for i in input().split()] ns [int(i) for i in input().split()] tree = Tree(ns) tree Tree(ns) Tree ns _ = int(input()) _ int(input()) int input() input for q in (int(j) for j in input().split()):
        if tree.has_subset(q):
            print("yes")
        else:
            print("no") q (int(j) for j in input().split()) if tree.has_subset(q):
            print("yes")
        else:
            print("no") tree.has_subset(q) tree.has_subset tree has_subset q print("yes") print "yes" print("no") print "no" if __name__ == '__main__':
    run_tree() __name__ == '__main__' __name__ '__main__' run_tree() run_tree def run_tree():
    _ = int(input())  # flake8: noqa
    ns = [int(i) for i in input().split()]

    tree = Tree(ns)
    _ = int(input())  # flake8: noqa

    for q in (int(j) for j in input().split()):
        if tree.has_subset(q):
            print("yes")
        else:
            print("no") def run_tree():
    _ = int(input())  # flake8: noqa
    ns = [int(i) for i in input().split()]

    tree = Tree(ns)
    _ = int(input())  # flake8: noqa

    for q in (int(j) for j in input().split()):
        if tree.has_subset(q):
            print("yes")
        else:
            print("no") run_tree class Tree:
    class Node:
        def __init__(self, n, left, right):
            self.left = left
            self.right = right
            self.n = n
            if left is not None:
                lt = {t + n for t in left.totals}
            else:
                lt = set()
            if right is not None:
                rt = right.totals
            else:
                rt = set()

            self.totals = lt | rt | {n}

        def find(self, total):
            return total in self.totals

        def __str__(self):
            cs = []
            if self.left is not None:
                cs.append(str(self.left))
            if self.right is not None:
                cs.append(str(self.right))

            return "{} -> ({})".format(self.n, ",".join(cs))


    def __init__(self, ns):
        self.top = self.build_nodes(sorted(ns))

    def has_subset(self, total):
        return self.top.find(total)

    def build_nodes(self, ns):
        if len(ns) == 0:
            return None

        left = self.build_nodes(ns[:-1])
        right = self.build_nodes(ns[:-1])
        node = self.Node(ns[-1], left, right)

        return node class Tree:
    class Node:
        def __init__(self, n, left, right):
            self.left = left
            self.right = right
            self.n = n
            if left is not None:
                lt = {t + n for t in left.totals}
            else:
                lt = set()
            if right is not None:
                rt = right.totals
            else:
                rt = set()

            self.totals = lt | rt | {n}

        def find(self, total):
            return total in self.totals

        def __str__(self):
            cs = []
            if self.left is not None:
                cs.append(str(self.left))
            if self.right is not None:
                cs.append(str(self.right))

            return "{} -> ({})".format(self.n, ",".join(cs))


    def __init__(self, ns):
        self.top = self.build_nodes(sorted(ns))

    def has_subset(self, total):
        return self.top.find(total)

    def build_nodes(self, ns):
        if len(ns) == 0:
            return None

        left = self.build_nodes(ns[:-1])
        right = self.build_nodes(ns[:-1])
        node = self.Node(ns[-1], left, right)

        return node Tree
class Tree:
    class Node:
        def __init__(self, n, left, right):
            self.left = left
            self.right = right
            self.n = n
            if left is not None:
                lt = {t + n for t in left.totals}
            else:
                lt = set()
            if right is not None:
                rt = right.totals
            else:
                rt = set()

            self.totals = lt | rt | {n}

        def find(self, total):
            return total in self.totals

        def __str__(self):
            cs = []
            if self.left is not None:
                cs.append(str(self.left))
            if self.right is not None:
                cs.append(str(self.right))

            return "{} -> ({})".format(self.n, ",".join(cs))


    def __init__(self, ns):
        self.top = self.build_nodes(sorted(ns))

    def has_subset(self, total):
        return self.top.find(total)

    def build_nodes(self, ns):
        if len(ns) == 0:
            return None

        left = self.build_nodes(ns[:-1])
        right = self.build_nodes(ns[:-1])
        node = self.Node(ns[-1], left, right)

        return node


def run_tree():
    _ = int(input())  # flake8: noqa
    ns = [int(i) for i in input().split()]

    tree = Tree(ns)
    _ = int(input())  # flake8: noqa

    for q in (int(j) for j in input().split()):
        if tree.has_subset(q):
            print("yes")
        else:
            print("no")



if __name__ == '__main__':
    run_tree()

