#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  vector<int> arr(n);
  for (int i = 0; i < n; ++i) cin >> arr[i];
  sort(arr.begin(), arr.end());
  long long num = 1;
  long long result;
  for (int i = n / 2; i < n - 1 && k > 0; ++i) {
    long long diff = arr[i + 1] - arr[i];
    if (k >= 1ll * diff * num) {
      k -= diff * num;
      num++;
      result = arr[i + 1];
    } else {
      result = arr[i] + k / num;
      k = 0;
      break;
    }
  }
  if (k > 0) {
    cout << arr[n - 1] + k / (n / 2 + 1) << endl;
    ;
  } else {
    cout << result << endl;
  }
  return 0;
}
