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