from math import gcd N = int(input()) A = list(map(int, input().split())) zero_count = A.count(0) AA = [] for x in A: if x != 0: AA.append(x) AA.sort() # print(zero_count, AA) if len(AA) <= 2: print("Yes") exit() poss = AA[1] - AA[0] pre = -10**15 for i in range(len(AA) - 1): dif = AA[i + 1] - AA[i] poss = gcd(poss, dif) # print(poss) ans = True for i in range(len(AA) - 1): dif = AA[i + 1] - AA[i] if poss == 0: if dif != 0: ans = 0 break else: continue if dif % poss != 0: # print(dif, poss) ans = 0 break zero_count -= dif // poss - 1 if zero_count < 0: # print(-1, dif, poss) ans = 0 break print("Yes" if ans else "No")