from functools import lru_cache def main(): import sys input = sys.stdin.read().split() N = int(input[0]) A = list(map(int, input[1:N+1])) def compute_possible_results(numbers): @lru_cache(maxsize=None) def helper(nums_tuple): if len(nums_tuple) == 1: return {nums_tuple[0]} results = set() nums = list(nums_tuple) n = len(nums) for i in range(n): for j in range(n): if i == j: continue a = nums[i] b = nums[j] remaining = tuple(sorted([nums[k] for k in range(n) if k != i and k != j] + [a + b])) results.update(helper(remaining)) remaining = tuple(sorted([nums[k] for k in range(n) if k != i and k != j] + [a - b])) results.update(helper(remaining)) remaining = tuple(sorted([nums[k] for k in range(n) if k != i and k != j] + [a * b])) results.update(helper(remaining)) if b != 0 and a % b == 0: div = a // b remaining = tuple(sorted([nums[k] for k in range(n) if k != i and k != j] + [div])) results.update(helper(remaining)) return results sorted_numbers = tuple(sorted(numbers)) return helper(sorted_numbers) found = False for mask in range(1, (1 << N) - 1): group_a = [] group_b = [] for i in range(N): if (mask >> i) & 1: group_a.append(A[i]) else: group_b.append(A[i]) if not group_a or not group_b: continue res_a = compute_possible_results(group_a) res_b = compute_possible_results(group_b) if res_a & res_b: found = True break print("YES" if found else "NO") if __name__ == "__main__": main()