#include <bits/stdc++.h>
using namespace std;
long long n, k;
vector<long long> a;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> k;
  a.reserve(n);
  for (long long i = 0; i < n; i++) {
    long long x;
    cin >> x;
    a.push_back(x);
  }
  sort(a.begin(), a.end());
  long long mid = a[n / 2];
  long long l = mid;
  long long r = a[n - 1] + k;
  long long ans = 0;
  long long s = 0;
  for (long long i = n / 2; i < (n - 1); i++) {
    s += a[n - 1] - a[i];
  }
  while (l <= r) {
    long long m = (l + r) / 2;
    long long tot = 0;
    if (m < a[n - 1]) {
      long long l = 0;
      for (long long j = n / 2; j < n; j++) {
        if (a[j] >= m) break;
        l += m - a[j];
      }
      tot += l;
    } else {
      tot = (m - a[n - 1]) * ((n / 2) + 1);
      tot += s;
    }
    if (tot == k) {
      cout << m << endl;
      return 0;
    } else if (tot < k) {
      ans = max(ans, m);
      l = m + 1;
    } else if (tot > k) {
      r = m - 1;
    }
  }
  cout << ans << endl;
}
