#include #include #include #include #include #include #include using namespace std; template void setmin(T& a, T& b) { a = min(a, b); } template void setmax(T& a, T& b) { a = max(a, b); } int x[100000]; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; for(int i = 0; i < N; i++) { cin >> x[i]; } sort(x, x + N); for(int i = 0; i < N - 1; i++) { if(x[i] == x[i + 1]) { cout << "NO" << endl; return 0; } } int diff = x[1] - x[0]; for(int i = 1; i < N - 1; i++) { if(x[i + 1] - x[i] != diff) { cout << "NO" << endl; return 0; } } cout << "YES" << endl; }