from sys import stdin
import numpy as np
from operator import itemgetter

N = int(stdin.readline().rstrip().split()[0])
A = [int(x) for x in stdin.readline().rstrip().split()]

ans = "Yes"
L = []
for a in A:
    if a in L:
        continue

    if len(L)>=3:
        ans = "No"
        break
    L.append(a)

l1, l2, l3 = L
while ans=="Yes":
    sumL = l1%2 + l2%2 + l3%2
    if sumL!=0 and sumL!=2:
        ans = "No"
        break
    l1 = l1//2
    l2 = l2//2
    l3 = l3//2
    if l1+l2+l3==0:
        break
print(ans)
