#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, k, a[N];
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + 1 + n);
  int p = n / 2 + 1, t = n / 2 + 1;
  for (int i = n / 2 + 2; i <= n; i++)
    if (1ll * (a[i] - a[i - 1]) * (i - t) > k)
      break;
    else {
      k -= 1ll * (a[i] - a[i - 1]) * (i - t);
      p = i;
    }
  printf("%d\n", a[p] + k / (p - t + 1));
}
