#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k;
  cin >> n >> k;
  long long int a[n];
  for (long long int i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  long long int mid = n / 2;
  long long int ptr = n / 2 + 1, c = 0, s = 0;
  while (k > 0 && ptr < n) {
    c++;
    k -= c * (a[ptr] - a[ptr - 1]);
    if (k >= 0)
      a[n / 2] += (a[ptr] - a[ptr - 1]);
    else if (k < 0) {
      k += c * (a[ptr] - a[ptr - 1]);
      n = ptr;
      break;
    }
    ptr++;
  }
  if (k > 0) {
    k /= (n - mid);
    a[mid] += k;
  }
  cout << a[mid];
  return 0;
}
