#include <bits/stdc++.h>
using namespace std;
long long int n, k;
long long int a[200100];
bool check(long long int x) {
  long long int moves = 0;
  for (__typeof(n + 1) i = (n / 2 + 1) - ((n / 2 + 1) > (n + 1));
       i != (n + 1) - ((n / 2 + 1) > (n + 1));
       i += 1 - 2 * ((n / 2 + 1) > (n + 1))) {
    moves += max((long long int)0, x - a[i]);
    if (moves > k) return false;
  }
  if (moves <= k) return true;
  return false;
}
void solve() {
  cin >> n >> k;
  for (__typeof(n + 1) i = (1) - ((1) > (n + 1));
       i != (n + 1) - ((1) > (n + 1)); i += 1 - 2 * ((1) > (n + 1))) {
    cin >> a[i];
  }
  sort(a + 1, a + n + 1);
  long long int l = 1, r = 2e9;
  bool can = false;
  while (l < r) {
    long long int mid = (l + r + 1) / 2;
    if (check(mid)) {
      l = mid;
    } else {
      r = mid - 1;
    }
  }
  cout << l << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    solve();
  }
}
