#include #include #include #include #include #include #include #include #include #include using ll = long long; using namespace std; int main(){ ll n, cnt = 0, ave = 0, dif = 0; cin >> n; vector a(n); for (int i = 0; i < n; i++){ cin >> a[i]; cnt += a[i]; } if (cnt%n == 0) ave = cnt/n; else { cout << "No" << endl; return 0; } for (int i = 0; i < n; i++){ dif += abs(a[i] - ave); } cout << ((dif%n == 0) ? "Yes" : "No") << endl; }