#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  long long n, k;
  cin >> n >> k;
  vector<long long> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  long long int x = 0;
  long long int l = 0;
  long long int r = 2e9 + 2;
  long long int newmed = 0;
  long long int res = 0;
  while (l <= r) {
    newmed = l + (r - l) / 2;
    long long int cost = 0;
    for (int i = n / 2; i < n; i++) {
      if (newmed - a[i] <= 0) break;
      cost += newmed - a[i];
    }
    if (cost > k) {
      r = newmed - 1;
    } else if (cost <= k) {
      res = newmed;
      l = newmed + 1;
    }
  }
  cout << res << endl;
  return 0;
}
