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): print(L[i] - L[i - 1]) if L[i] - L[i - 1] == d: print("NO") exit() print("YES")