#include #define FOR(i, n, m) for (long long i = (n); i < (long long)(m); i++) #define REP(i, n) FOR(i, 0, n) #define ALL(v) v.begin(), v.end() #define pb push_back using namespace std; using ll = long long; using ld = long double; using P = pair; constexpr ll inf = 1000000000; constexpr ll mod = 998244353; constexpr ld eps = 1e-6; template ostream &operator<<(ostream &os, pair p) { os << to_string(p.first) << " " << to_string(p.second); return os; } template ostream &operator<<(ostream &os, vector &v) { REP(i, v.size()) { if (i) os << " "; os << v[i]; } return os; } int main() { cin.tie(0); ios::sync_with_stdio(false); int n; cin >> n; vector a; map mp; int mx = 0; REP(i, n) { ll num; cin >> num; if (num != 0) { a.pb(num); mp[num]++; mx = max(mx, mp[num]); } } if ((int)a.size() <= 1) { cout << "Yes" << endl; return 0; } sort(ALL(a)); if (mx >= 2) { if (a.front() == a.back()) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; } ll g = a[1] - a[0]; FOR(i, 1, a.size()) g = gcd(g, a[i] - a[i - 1]); if ((a.back() - a.front()) / g <= n - 1) { cout << "Yes" << endl; } else { cout << "No" << endl; } return 0; }