#include <bits/stdc++.h>
using namespace std;
int main() {
  long long q, w;
  cin >> q >> w;
  vector<long long> v(q);
  for (long long x = 0; x < q; x++) {
    cin >> v[x];
  }
  sort(v.begin(), v.end());
  v.erase(v.begin(), v.end() - (q / 2 + 1));
  long long mn = v[0], cou = 1;
  for (long long x = 1; x < v.size(); x++) {
    long long m = 0;
    if (v[x] - mn < w / cou)
      m = v[x] - mn;
    else
      m = w / cou;
    w -= (m * cou);
    cou++;
    mn += m;
    if (w / cou == 0) break;
  }
  mn += (w / (v.size()));
  cout << mn;
  return 0;
}
