from math import gcd N = int(input()) A = list(map(int, input().split())) L = [] zero = 0 for a in A: if a == 0: zero += 1 else: L.append(a) L.sort() if len(set(L)) <= 1: print("Yes") exit() D = [] for i in range(len(L) - 1): D.append(L[i + 1] - L[i]) minv = D[0] for d in D: minv = gcd(minv, d) if d == 0: minv = 0 break if minv == 0: print("No") exit() cnt = 0 for d in D: cnt += d - 1 if cnt <= zero: print("Yes") exit() cnt = 0 for d in D: if d % minv != 0: print("No") exit() cnt += d // minv - 1 if cnt <= zero: print("Yes") else: print("No")