#include <bits/stdc++.h>
using namespace std;
int main() {
  long long t;
  t = 1;
  while (t--) {
    long long n, k;
    cin >> n >> k;
    long long a[n], median = 0;
    for (long long i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n);
    median = a[n / 2];
    long long i = n / 2;
    if (k <= a[i + 1] - a[i]) {
      median += k;
      cout << median << endl;
      continue;
    } else {
      median += a[i + 1] - a[i];
      k -= a[i + 1] - a[i];
    }
    for (long long j = n / 2; j < n; j++) {
      if (j == n - 1)
        median += k / (j - i + 1);
      else if (a[j] == median) {
        k -= (j - i + 1) * (a[j + 1] - a[j]);
        if (k < 0) {
          k += (j - i + 1) * (a[j + 1] - a[j]);
          k /= (j - i + 1);
          median += k;
          break;
        } else
          median += (a[j + 1] - a[j]);
      }
    }
    cout << median << endl;
  }
}
