n = int(input()) x = tuple(sorted(map(int, input().split()))) print("YES" if len(set(x)) == n and len(set(x[i + 1] - x[i] for i in range(n - 1))) == 1 else "NO")