#include <bits/stdc++.h>
using namespace std;
long long int n, k, x[999999];
long long int ck(long long int mid) {
  long long int c = 0, i, ll = 0;
  for (i = n / 2; i < n; i++) {
    c += max(ll, mid - x[i]);
    if (c > k) return c;
  }
  return c;
}
int main() {
  cin >> n >> k;
  long long int i, j, l, lo, hi, mid, need, mx = -1;
  for (i = 0; i < n; i++) cin >> x[i];
  sort(x, x + n);
  lo = x[n / 2];
  hi = lo + k;
  mx = lo;
  while (lo <= hi) {
    mid = (lo + hi) / 2;
    need = ck(mid);
    if (need <= k) {
      mx = max(mx, mid);
      lo = mid + 1;
    } else
      hi = mid - 1;
  }
  cout << mx << endl;
  return 0;
}
