N = int(input())
a = list(map(int,input().split()))
if N % 3:
  print('No')
else:
  a.sort()
  for i in range(0,N,3):
    if not (a[i]==a[i+1]==a[i+2]):
      print('No')
      break
  else:
    print('Yes')