#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 7;
long long n, k, a[N];
int main() {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  if (n == 1) {
    cout << a[1] + k << "\n";
    return 0;
  }
  sort(a + 1, a + n + 1);
  int pos = n / 2 + 1, ed = -1;
  long long mid = a[pos];
  for (int i = pos + 1; i <= n; i++) {
    if (a[i] != a[i - 1]) {
      if (k >= 1ll * (a[i] - a[i - 1]) * (i - pos)) {
        k -= 1ll * (a[i] - a[i - 1]) * (i - pos);
        mid += (a[i] - a[i - 1]);
      } else {
        ed = i;
        break;
      }
    }
    if (k == 0) break;
  }
  if (k > 0 && k >= (n - pos + 1) && ed == -1) {
    mid += k / (n - pos + 1);
  }
  if (ed != -1 && k > 0) {
    mid += k / (ed - pos);
  }
  cout << mid << "\n";
  return 0;
}
