#include <bits/stdc++.h>
using namespace std;
long long int n, k;
vector<long long int> arr;
bool check(long long int x) {
  long long int moves = 0;
  for (int i = n / 2; i < n; i++) {
    if (x - arr[i] > 0) moves += x - arr[i];
    if (moves > k) return false;
  }
  if (moves <= k)
    return true;
  else
    return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> k;
  arr.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr.begin(), arr.end());
  long long small = 1;
  long long big = 2000000000;
  while (small != big) {
    long long mid = (small + big + 1) / 2;
    if (check(mid)) {
      small = mid;
    } else {
      big = mid - 1;
    }
  }
  cout << small;
  return 0;
}
