from math import * N = int(input()) A = sorted(list(map(int, input().split()))) c = 0 # 0 の数 B = [] for a in A: if a == 0: c += 1 else: B.append(a) # print('c',c) # print('B',B) D = [] # 差 for i in range(1,len(B)): D.append(B[i]-B[i-1]) # print('D',D) if len(D) == len([d for d in D if d == 0]): print('Yes') exit() G = gcd(*D) # 差の最大公約数 # print('G',G) s = 0 for d in D: s += (d // G) - 1 # print('s',s) if c >= s and s >= 0: print('Yes') else: print('No')