#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  long long a[n + 1], sum = 0;
  for (int i = 0; i < n; i++) cin >> a[i];
  if (n == 1) {
    cout << 1LL * (a[0] + k) << "\n";
    return 0;
  }
  sort(a, a + n);
  long long ans = 0, brake = n;
  for (int i = n / 2 + 1; i < n; i++) {
    sum += (a[i] - (a[i - 1])) * (i - n / 2);
    if (sum > k) {
      sum -= (a[i] - (a[i - 1])) * (i - n / 2);
      brake = i;
      break;
    }
  }
  k -= sum;
  long long round = brake - (n / 2);
  ans = a[brake - 1] + (k / round);
  cout << ans << "\n";
  return 0;
}
