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) if z == n: print('Yes') exit() d = 10**18 B.sort() for i in range(len(B)-1): d = min(d, B[i+1]-B[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')