#include #define rep(i,n) for(int i = 0; i < (n); i++) using namespace std; typedef long long ll; int main(){ cin.tie(0); ios::sync_with_stdio(0); int N; cin >> N; vector x(N); rep(i,N) cin >> x[i]; sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end()); if(int(x.size()) != N) { cout << "NO" << endl; return 0; } rep(i,N-1) { if(x[i + 1] - x[i] != x[1] - x[0]) { cout << "NO" << endl; return 0; } } cout << "YES" << endl; return 0; }