#include #include #define MAX 100000 int main() { unsigned int n, a[MAX]; std::cin >> n; for (int i = 0; i < n; i++) { std::cin >> a[i]; } std::sort(a, a + MAX); int r = a[1] - a[0]; if (r == 0) { std::cout << "NO" << std::endl; return 0; } for (int i = 2; i < n; i++) { if ((r != a[i] - a[i - 1]) || (a[i] == a[i - 1])) { std::cout << "NO" << std::endl; return 0; } r = a[i] - a[i - 1]; } std::cout << "YES" << std::endl; return 0; }