#include <bits/stdc++.h>
using namespace std;
const int maxn = 200003;
const long long INF = 1000000000000ll;
int n;
long long k, a[maxn];
int main() {
  scanf("%d%lld", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%lld", a + i);
  sort(a + 1, a + n + 1);
  a[n + 1] = INF;
  int i = n / 2 + 1, j = i;
  long long cnt = 0, ans = a[i];
  while (1) {
    for (; j <= n && a[i] == a[j]; j++)
      ;
    if (cnt + (j - n / 2 - 1) * (a[j] - a[i]) > k) break;
    cnt += (j - n / 2 - 1) * (a[j] - a[i]);
    ans = a[j];
    i = j;
  }
  ans += (k - cnt) / (j - n / 2 - 1);
  printf("%lld\n", ans);
  return 0;
}
