N = int(input())
import numpy as np
a = np.array(list(map(int,input().split())))
a = np.sort(a)

if N%3!=0:
  if max(a)==0:
    print("Yes")
  else:
    print("No")
else:
  f=True
  M = N//3
  while a[-1]!=0 and f:
    f = np.count_nonzero(a % 2) == 2*M
    a //= 2
  if f:
    print("Yes")
  else:
    print("No")
  