#include <bits/stdc++.h>
using namespace std;
const double EPS = 1e-9;
long long POW(long long b, long long p) {
  long long Ans = 1;
  while (p) {
    if (p & 1) Ans = (Ans * b);
    b = (b * b);
    p >>= 1;
  }
  return Ans;
}
long long BigMod(long long b, long long p, long long Mod) {
  long long Ans = 1;
  while (p) {
    if (p & 1) Ans = (Ans * b) % Mod;
    b = (b * b) % Mod;
    p >>= 1;
  }
  return Ans % Mod;
}
long long ModInverse(long long b, long long Mod) {
  return BigMod(b, Mod - 2, Mod);
}
string tostr(int n) {
  stringstream rr;
  rr << n;
  return rr.str();
}
void deb(istream_iterator<string> it) { cout << endl; }
template <typename T, typename... Args>
void deb(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << ",   ";
  deb(++it, args...);
}
int main() {
  long long n, k;
  cin >> n >> k;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  if (n == 1) {
    return cout << a[0] + k << "\n", 0;
  }
  sort(a, a + n);
  long long id = n / 2;
  long long lo = 0, hi = 1000000000 * 2 + 10, ans;
  while (lo <= hi) {
    long long mid = (hi + lo) / 2;
    long long cnt = 0;
    for (int i = id; i < n; i++) cnt += max(0LL, mid - a[i]);
    if (cnt <= k)
      ans = mid, lo = mid + 1;
    else
      hi = mid - 1;
  }
  cout << ans << "\n";
}
