#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long n, k;
  cin >> n >> k;
  long long a[n + 1];
  a[0] = 0;
  for (int i = 1; i < n + 1; i++) {
    cin >> a[i];
  }
  sort(a, a + n + 1);
  long long z = (n + 1) / 2;
  long long ans = a[z];
  long long log = 1, y = 0;
  for (int i = z; i <= n - 1; i++) {
    long long x = (a[i + 1] - a[i]) * log;
    if (k >= x) {
      log++;
      ans = (a[i + 1]);
      k = k - x;
    } else {
      break;
      ans += (k) / log;
      k = 0;
      log++;
    }
  }
  ans += (k / log);
  cout << ans << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
}
