#include <bits/stdc++.h>
using namespace std;
string score[10000];
long long a[2000000];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n, k;
  cin >> n >> k;
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  long long i = n / 2, s = n / 2, val = a[n / 2];
  i++;
  while (i < n && k > 0) {
    long long maxinc = (a[i] - a[i - 1]) * (i - s);
    if (maxinc <= k)
      val = a[i];
    else {
      val += k / (i - s);
    }
    k -= min(k, maxinc);
    i++;
  }
  if (k > 0) {
    val += k / (n - s);
  }
  cout << val << endl;
  return 0;
}
