# -*- coding: utf-8 -*-

N = int(input())
a = list(map(int, input().split()))
a = sorted(a)
tmp = [2**x for x in range(30)]
flag = True
cnt = 0
for x in a:
    if x in tmp:
        cnt += 1
        if cnt > 1:
            flag = False
            break

if flag:
    pp = a.pop(0)
    p = a.pop(0)
    for x in a:
        if x - p != pp:
            flag = False
            break
        pp = p
        p = x

if flag:
    print("Yes")
else:
    print("No")