#include <bits/stdc++.h>
using namespace std;
long long a[10000005];
int main() {
  long long n, k;
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  long long s = 0, e = 2000000000LL;
  long long ans = 0;
  while (s <= e) {
    long long m = (s + e) / 2;
    long long need = 0;
    for (int i = n / 2; i < n; i++) {
      if (a[i] < m) need += m - a[i];
    }
    if (need <= k) {
      ans = m;
      s = m + 1;
    } else
      e = m - 1;
  }
  cout << ans << endl;
  return 0;
}
