#include #include #include using namespace std; int main() { int n; cin >> n; vector x(n); for(int i = 0; i < n; i++){ cin >> x[i]; } sort(x.begin(), x.end()); int start = x[1]; int inte = x[1]-x[0]; if(inte == 0){ cout << "NO" << endl; } else { int pos = start; for(int i = 2; i < n; i++){ if(x[i] != pos+inte){ cout << "NO" << endl; return 0; } } cout << "YES" << endl; } return 0; }