#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int ta, n, i, j, k, diff = 0, maxf, c[200002], b[200002], m, sum,
                                f = 0;
  cin >> n;
  cin >> k;
  for (i = 0; i < n; i++) cin >> b[i];
  sort(b, b + n);
  m = n / 2;
  j = 0;
  for (i = m + 1; i < n; i++) c[j] = b[i] - b[i - 1], j++;
  sum = 0;
  for (i = 0; i < j; i++) {
    sum = sum + (i + 1) * c[i];
    if (k < sum) {
      f = 1;
      break;
    }
  }
  if (i == j && k - sum > 0) {
    ta = n - m;
    diff = (k - sum) / ta;
    cout << b[m + i] + diff << endl;
  } else if (f == 1) {
    sum = sum - (i + 1) * c[i];
    diff = (k - sum) / (i + 1);
    cout << b[m + i] + diff << endl;
  } else if (f == 0)
    cout << b[m + i] << endl;
}
