#include #include #include #define rep(i,n) for(i=0; i>n; vector v(n); int i,num; rep(i,n) { cin>>num; v[i] = num; } sort(v.begin(), v.end()); num = v[1]-v[0]; if (!num) { end_NO(); return 0; } rep2(i,1,v.size()-1) { if(num!=v[i+1]-v[i]) { end_NO(); return 0; } } cout << "YES" << endl; return 0; }