#include using namespace std; #define ALL(obj) (obj).begin(), (obj).end() #define rALL(obj) (obj).rbegin(), (obj).rend() using ll = long long; int main() { int N; cin >> N; vector A(N); for (int i = 0; i < N; i++) cin >> A[i]; sort(ALL(A)); const ll INF = 1LL << 60; ll t = INF; int z = 0; for (int i = 0; i < N-1; i++) { if(A[i] == 0) z++; else t = min(t, A[i+1] - A[i]); } if(t == INF) { cout << "Yes" << endl; return 0; } bool ans = true; for (int i = 0; i < N-1; i++) { if(A[i] == 0) continue; ll x = A[i+1] - A[i]; if(x == t) continue; if(x % t) ans = false; z -= x / t -1; if(z < 0) ans = false; } cout << (ans ? "Yes" : "No") << endl; return 0; }