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