#include <bits/stdc++.h>
using namespace std;
long long int n, k, p;
long long int arr[2 * 100007];
bool check(long long int mid) {
  long long int sum = 0, i;
  for (i = p; i < n; i++) {
    sum += max(0LL, mid - arr[i]);
  }
  if (sum > k)
    return false;
  else
    return true;
}
long long int bs_upperbound(long long int l, long long int r) {
  long long int mid;
  while (l < r) {
    mid = (l + r + 1) >> 1;
    if (check(mid))
      l = mid;
    else
      r = mid - 1;
  }
  return l;
}
int main() {
  long long int l, r, i;
  scanf("%lld %lld", &n, &k);
  for (i = 0; i < n; i++) scanf("%lld", &(arr[i]));
  sort(arr, arr + n);
  p = (n >> 1);
  r = arr[n - 1] + k + 1;
  l = arr[0];
  cout << bs_upperbound(l, r) << endl;
  return 0;
}
