#include <bits/stdc++.h>
using namespace std;
const long long int N = 3 * 1e6 + 2;
long long int n, k;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  vector<long long int> v(n);
  for (long long int i = 0; i < n; i++) cin >> v[i];
  sort((v).begin(), (v).end());
  auto solve = [&](long long int med) {
    long long int need = 0;
    for (long long int i = n / 2; i < n; i++) {
      if (v[i] >= med) continue;
      need += med - v[i];
    }
    return (need <= k);
  };
  long long int lo = v[n / 2], hi = 1e12;
  while (lo < hi) {
    long long int mid = (lo + hi) >> 1;
    if (solve(mid))
      lo = mid + 1;
    else
      hi = mid;
  }
  cout << lo - 1 << '\n';
  return 0;
}
