
N = int(input())
a_list = input().split(' ')

a = [int(i) for i in a_list]
a.sort()

delta = a[1]-a[0]
NG_flag = False
for i in range(1,N+1):
    if a[i]-a[i-1] != delta:
        NG_flag = True

if NG_flag:
    print('No')
else:
    print('Yes')
