#include using namespace std; int main() { int N; cin >> N; vector X(N); for (int i = 0; i < N; i++) cin >> X.at(i); sort(X.begin(), X.end()); int tmp = X.at(1) - X.at(0); string ans = "YES"; for (int i = 1; i < N; i++) if (X.at(i) - X.at(i - 1) != tmp) ans = "NO"; cout << ans << "\n"; }