#include using namespace std; int main() { cin.sync_with_stdio(0), cin.tie(0), cout.tie(0); int n; int x[100010]; cin >> n; for (int i = 0; i < n; i++) { cin >> x[i]; } sort(x, x + n); int a = abs(x[1] - x[0]); for (int i = 1; i < n; i++) { int y = abs(x[i] - x[i - 1]); if (a != y || x[i] == x[i - 1]) { cout << "NO" << endl; return 0; } } cout << "YES" << endl; }