import math import collections N=int(input()) lsA = list(map(int,input().split())) cnt0 = 0 lsA1 = [] for i in range(N): if lsA[i] == 0: cnt0 += 1 else: lsA1.append(lsA[i]) lsA1.sort() if len(lsA1) == 0: print('Yes') exit() cnt = collections.Counter(lsA1) if len(cnt)==1: print('Yes') exit() vals = max(list(cnt.values())) if vals > 1: print('No') exit() gcd = lsA1[1]-lsA1[0] for i in range(1,len(lsA1)-1): gcd = math.gcd(lsA1[i+1]-lsA1[i],gcd) lsA1.reverse() st = lsA1.pop() for i in range(N-1): if not lsA1: print('Yes') exit() if lsA1[-1] == st+gcd: st = lsA1.pop() else: if cnt0 == 0: print('No') exit() else: cnt0 -= 1 st = st+gcd print('Yes')