#include <bits/stdc++.h>
using namespace std;
long long c = 0;
const int N = 300005;
int a[N], n, k, res;
bool check(long long m) {
  k = n / 2 + 1;
  long double sum = 0;
  for (int i = k; i <= n; i++) {
    sum += max(c, m - a[i]);
  }
  if (sum <= res) {
    return true;
  } else
    return false;
}
int main() {
  scanf("%d%d", &n, &res);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a + 1, a + 1 + n);
  long long l = 1, r = 1e18;
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (check(mid) == true) {
      l = mid + 1;
    } else {
      r = mid - 1;
    }
  }
  printf("%lld", r);
  return 0;
}
