N = int(input()) L = sorted(list(map(int(input().split())))) d = L[1] - L[0] if d == 0: print('NO') exit() for i in range(2, N): if L[i] - [i - 1] == d: print('NO') break else: print('YES')