#include <bits/stdc++.h>
using namespace std;
long long int N, K;
long long int arr[200005];
bool check(long long int mid) {
  long long int cnt = 0;
  for (int i = (N / 2); i < N; i++) {
    if (mid - arr[i] > 0) {
      cnt += mid - arr[i];
      if (cnt > K) {
        return 0;
      }
    }
  }
  if (cnt <= K) {
    return 1;
  }
  return 0;
}
long long int bs() {
  long long int low = arr[N / 2];
  long long int high = 1e15;
  while (high - low > 1) {
    long long int mid = low + (high - low) / 2;
    if (!check(mid)) {
      high = mid;
    } else {
      low = mid;
    }
  }
  if (check(high)) {
    return high;
  } else {
    return low;
  }
}
int main() {
  scanf("%lld %lld", &N, &K);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &arr[i]);
  }
  sort(arr, arr + N);
  cout << bs();
  return 0;
}
