#include <bits/stdc++.h>
using namespace std;
long long n, k, ar[200000];
int ok(long long i) {
  long long num = 0;
  for (int a = (n - 1) / 2; a < n; a++) {
    num += max((long long)0, i - ar[a]);
  }
  if (num <= k)
    return 1;
  else
    return 0;
}
long long solve() {
  long long pos = 0, mx = 2e9;
  for (long long i = mx; i >= 1; i /= 2) {
    while (ok(pos + i)) pos += i;
  }
  return pos;
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    cin >> ar[i];
  }
  sort(ar, ar + n);
  cout << solve() << endl;
}
