#include <bits/stdc++.h>
using namespace std;
bool possible(long long arr[], int n, long long m, long long k) {
  long long moves = 0;
  for (int i = n / 2; i < n; ++i) {
    if (m - arr[i] > 0) moves += m - arr[i];
    if (moves > k) return false;
  }
  return moves <= k;
}
int main() {
  int n;
  cin >> n;
  long long k, arr[n];
  cin >> k;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  long long low = 0, high = arr[n - 1] + k;
  while (low <= high) {
    long long mid = low + (high - low) / 2;
    if (possible(arr, n, mid, k)) {
      low = mid + 1;
    } else {
      high = mid - 1;
    }
  }
  cout << low - 1;
}
