#include <bits/stdc++.h>
using namespace std;
long long canWe(vector<int> &arr, int mid) {
  long long cnt = 0;
  int median = arr.size() / 2;
  for (int i = median; i < arr.size() && arr[i] < mid; i++) {
    cnt += (mid - arr[i]);
  }
  return cnt;
}
int greatestMedian(vector<int> &arr, int k) {
  sort(arr.begin(), arr.end());
  int mid = arr.size() / 2;
  int s = arr[mid], e = 2e9 + 1;
  while (s < e) {
    mid = s + (e - s) / 2;
    if (canWe(arr, mid) <= k)
      s = mid + 1;
    else
      e = mid;
  }
  return s - 1;
}
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, k;
  cin >> n >> k;
  vector<int> arr(n);
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  cout << greatestMedian(arr, k) << '\n';
}
