#include #define endl '\n' typedef long long ll; using namespace std; int main(void) { ios::sync_with_stdio(false); cin.tie(0); int n; cin >> n; vector a(n); for (int i = 0; i < n; i++) { cin >> a[i]; } ll tot = accumulate(a.begin(), a.end(), 0LL); string ans = "No"; if (tot % n == 0) { ll m = tot / n; ll diff = 0; for (int i = 0; i < n; i++) { diff += a[i] - m; } if (diff % (n - 1) == 0) ans = "Yes"; } cout << ans << endl; return 0; }