#include #include using namespace std; using Mint = atcoder::modint998244353; int main() { ios::sync_with_stdio(false); cin.tie(0); int N; cin >> N; vector V; for (int i = 0; i < N; ++i) { long long x; cin >> x; if (x != 0) V.push_back(x); } sort(V.begin(), V.end()); long long g = 0; bool eq = 0; for (int i = 0; i < (int)V.size() - 1; ++i) { g = gcd(g, V[i + 1] - V[i]); if (V[i] == V[i + 1]) eq = 1; } if (g == 0) { cout << "Yes" << endl; return 0; } if (eq) { cout << "No" << endl; return 0; } long long rng = V.back() - V.front(); long long cnt = rng / g + 1; if (cnt <= N) cout << "Yes" << endl; else cout << "No" << endl; }