#include <bits/stdc++.h>
using namespace std;
vector<long long> V;
long long n, k;
bool Check(long long M) {
  long long cnt = 0;
  for (int i = n / 2; i < n; i++) {
    if (V[i] < M)
      cnt = cnt + (M - V[i]);
    else
      break;
    if (cnt > k) return 1;
  }
  return 0;
}
int main() {
  cin >> n >> k;
  for (int i = 0; i < n; i++) {
    long long a;
    cin >> a;
    V.push_back(a);
  }
  sort(V.begin(), V.end());
  long long M;
  long long Median = V[n / 2];
  long long HMedian = 1e17;
  while (Median < HMedian) {
    M = (Median + HMedian) / 2;
    if (Check(M))
      HMedian = M;
    else
      Median = M + 1;
  }
  Median--;
  cout << Median;
}
