#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  long long k;
  scanf("%d %lld", &n, &k);
  vector<long long> tmp(n), ar;
  for (int i = 0; i < n; i++) {
    scanf("%lld", &tmp[i]);
  }
  sort(tmp.begin(), tmp.end());
  for (int i = n / 2; i < n; i++) {
    ar.push_back(tmp[i]);
  }
  n = ar.size();
  long long lo = ar[0];
  long long hi = ar[n - 1] + k;
  long long ans = -1;
  while (lo <= hi) {
    long long mid = (lo + hi) / 2;
    long long sum = 0;
    for (int i = 0; i < n; i++) {
      if (ar[i] < mid) {
        sum += (mid - ar[i]);
      }
    }
    if (sum <= k) {
      ans = max(ans, mid);
      lo = mid + 1;
    } else {
      hi = mid - 1;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
