import sys
input = sys.stdin.readline
 
def main():
  n = int(input())
  numList = []
  numList = list(map(int,input().split()))
  count = int(n / 3)
  tmp =0
 
  result = 'No'
  
  if n%3 == 0 and len(numList) > 2:
    a = sum(i == numList[0] for i in numList)
    y = sum(j == numList[1] for j in numList)
    xor = sum(k == numList[2] for k in numList)
    if a  == count and y  == count and xor  == count:
      result = 'Yes'
  else:
    for num in numList:
      tmp += num
    
    if tmp == 0:
      result = 'Yes'
    
  print(result)
  
if __name__ == '__main__':
  main()