n = int(input()) A = list(map(int, input().split())) A.sort() z = 0 B = [] for a in A: if a == 0: z += 1 else: B.append(a) d = 10**18 for i in range(n-1): if A[i] == 0 or A[i+1] == 0: continue d = min(d, A[i+1]-A[i]) if d == 10**18: print('Yes') exit() if d == 0: if len(set(B)) == 1: print('Yes') else: print('No') exit() B.sort(reverse=True) cur = B[0]+d cnt = 0 for b in B: if (cur-b)%d != 0: print('No') exit() cnt += (cur-b)//d-1 cur = b if cnt <= z: print('Yes') else: print('No')