#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ii = pair<int, int>;
const int mod = 1e9 + 7;
int v[200005];
int n, k;
bool guess(int x) {
  ll spent = x - v[n / 2];
  for (int i = n / 2 + 1; i < n; i++) {
    spent += max(0, x - v[i]);
    if (spent > (ll)k) return false;
  }
  return spent <= (ll)k;
}
int solve() {
  int x = -1;
  for (int b = v[n - 1] + k; b >= 1; b /= 2)
    while (guess(x + b)) x += b;
  return x;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> k;
  for (int i = 0; i < n; i++) cin >> v[i];
  sort(v, v + n);
  cout << solve() << '\n';
  return 0;
}
