#include using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector a(n); for(int i = 0; i < n; i++) { cin >> a[i]; } sort(a.begin(), a.end()); int dif = a[1] - a[0]; for(int i = 1; i < n; i++) { if(dif == 0 || dif != a[i] - a[i - 1]) { puts("NO"); return 0; } } puts("YES"); return 0; }