N = int(input())
a = list(map(int,input().split()))
if N % 3:
  print('No')
else:
  a.sort()
  for i in range(N):
    if a[i] != a[(i//(N//3))*(N//3)]:
      print('No')
      break
  else:
    print('Yes')
