N = int(input()) A = list(map(int, input().split())) num = A.count(0) A.sort() d = 10**16 for i in range(N-1): if A[i+1] == 0: continue tmp = A[i+1] - A[i] d = min(tmp,d) A.reverse() ans = "Yes" for i in range(N-1): if A[i+1] == 0: continue if A[i+1] - A[i] == d: continue if (A[i] - A[i+1])%d != 0: ans = "No" break else: num -= (A[i] - A[i+1])//d - 1 print(ans if num >= 0 else "No")