#include <bits/stdc++.h>
using namespace std;
long long n, k;
long long a[200010];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  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 + 1 + n);
  long long mid = ceil(n / 2.);
  int idx = -1;
  for (int i = mid + 1; i <= n; ++i) {
    if (a[i] > a[mid]) {
      idx = i;
      break;
    }
  }
  if (idx != -1) {
    while (a[idx] > a[mid]) {
      if (k == 0) break;
      long long posdif = idx - mid;
      long long add = k / posdif;
      add = min(add, a[idx] - a[mid]);
      k -= posdif * add;
      a[mid] += add;
      idx++;
      if (idx > n) break;
    }
  }
  long long posdif = n - mid + 1;
  long long ans = a[mid] + floor((double)k / posdif);
  cout << ans << '\n';
}
