#include using namespace std; int main() { int n; cin >> n; vector a(n); for (int &e : a) cin >> e; sort(a.begin(), a.end()); const int d = a[1] - a[0]; bool ok = (d > 0); for (int i = 1; i + 1 < n; i++) { ok &= (d == a[i+1] - a[i]); } cout << (ok ? "YES" : "NO") << '\n'; return 0; }