#include <bits/stdc++.h>
using namespace std;
long long arr[200005];
bool can(long long val, long long n, long long k) {
  int m = (n + 1) / 2;
  long long sum = 0;
  for (int i = m; i <= n; i++) {
    if (val > arr[i])
      sum += val - arr[i];
    else
      break;
  }
  if (sum <= k)
    return true;
  else
    return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, k;
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  sort(arr + 1, arr + n + 1);
  long long l = arr[(n + 1) / 2];
  long long h = 3000000001;
  while (l < h - 1) {
    long long m = (l + h) / 2;
    if (can(m, n, k)) {
      l = m;
    } else {
      h = m;
    }
  }
  if (can(h, n, k)) l = h;
  cout << l << '\n';
}
