# -*- coding: utf-8 -*-

N = int(input())
a = list(map(int, input().split()))
a = sorted(a)

prev = a[1]
diff = a.pop(0) - a.pop(0)
flag = True
for x in a:
    if prev - x != diff:
        flag = False
        break
    prev = x

if flag:
    print("Yes")
else:
    print("No")