#include <bits/stdc++.h>
using namespace std;
int casos;
vector<long long> elems;
long long cant, disp;
int main() {
  cin.tie(0), ios_base::sync_with_stdio(0), cout.tie(0);
  cin >> cant >> disp;
  for (int i = 0; i < cant; i++) {
    long long temp;
    cin >> temp;
    elems.push_back(temp);
  }
  sort(elems.begin(), elems.end());
  long long ini = 0;
  long long fin = elems[cant / 2] + disp + 1;
  int posmed = cant / 2;
  long long medio;
  long long resp = 0;
  for (int i = 0; i < 400; i++) {
    medio = (ini + fin) / 2;
    bool pos = true;
    long long llevar = medio;
    long long disptemp = disp;
    for (int j = posmed; j < cant; j++) {
      if (elems[j] < llevar) {
        if ((llevar - elems[j]) <= disptemp) {
          disptemp -= (llevar - elems[j]);
        } else {
          pos = false;
          break;
        }
      }
    }
    if (pos) {
      resp = medio;
      ini = medio;
    } else {
      fin = medio;
    }
  }
  cout << resp << "\n";
  return 0;
}
