#!/usr/bin/env python3
# -*- coding: utf-8 -*-

N = int(input())
l = [int(i) for i in input().split()]
l.sort()
a = l[-1]
bmax = 0
while a > 0:
    bmax += 1
    a = a // 2
    
bs = [0 for i in range(bmax)]
for i in l:
    count = 0
    while i > 0:
        bs[count] += i % 2
        count += 1
        i = i // 2
    
check = 0
for i in range(bmax):
    if bs[0] == N*2/3:
        check += 1
    else:
        break

if check == bmax:
    print("Yes")
else:
    print("No")
