#include <bits/stdc++.h>
using namespace std;
bool check(long long int mid, vector<long long int> a, long long int k) {
  long long int sum = 0;
  long long int n = a.size();
  for (long long int i = (n / 2); i < a.size(); i++) {
    if (mid > a[i]) {
      sum += mid - a[i];
    }
  }
  return sum <= k;
}
void solve() {
  long long int n, k;
  cin >> n >> k;
  long long int nn = n;
  vector<long long int> a;
  while (nn--) {
    long long int vl;
    cin >> vl;
    a.push_back(vl);
  }
  sort(a.begin(), a.end());
  long long int l = 1, r = 2e9 + 1;
  while (l < r) {
    long long int mid = l + (r - l) / 2;
    if (check(mid, a, k)) {
      l = mid + 1;
    } else {
      r = mid;
    }
  }
  cout << r - 1 << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int t;
  t = 1;
  while (t--) {
    solve();
  }
}
