#include <bits/stdc++.h>
using namespace std;
const int MAXN = (int)1e6;
long long int a[MAXN];
long long int n, k;
bool check(long long int mid) {
  long long int tot = 0;
  for (int i = (n + 1) / 2; i <= n; i++) {
    if (a[i] >= mid) break;
    tot += mid - a[i];
  }
  if (tot <= k)
    return true;
  else
    return false;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> a[i];
  sort(a + 1, a + n + 1);
  long long int l = a[(n + 1) / 2];
  long long int r = l + k;
  long long int ans = a[(n + 1) / 2];
  while (l <= r) {
    long long int mid = (l + r) >> 1;
    if (check(mid))
      ans = mid, l = mid + 1;
    else
      r = mid - 1;
  }
  cout << ans << "\n";
  return 0;
}
