#include #define rep(i,n) for(int i=0;i> N; rep(i,N) cin >> x[i]; sort(x, x + N); //rep(i,N) cout << x[i] << endl; if (x[1] == x[0]) { cout << "NO" << endl; return 0; } int sa = x[1] - x[0]; for (int i=1; i<=N-2; i++) { if (x[i+1] == x[i]) { cout << "NO" << endl; return 0; } if (x[i+1] - x[i] != sa) { cout << "NO" << endl; return 0; } } cout << "YES" << endl; }