#include <bits/stdc++.h>
using namespace std;
namespace _ {
bool rEOF = 1;
inline char nc() {
  static char buf[100000], *p1 = buf, *p2 = buf;
  return p1 == p2 && rEOF &&
                 (p2 = (p1 = buf) + fread(buf, 1, 100000, stdin), p1 == p2)
             ? (rEOF = 0, EOF)
             : *p1++;
}
template <class _T>
inline bool read(_T &num) {
  char c = nc(), f = 1;
  num = 0;
  while (c < '0' || c > '9') c == '-' && (f = -1), c = nc();
  while (c >= '0' && c <= '9') num = num * 10 + c - '0', c = nc();
  return (bool)(num *= f);
}
inline bool need(char &c) {
  return c >= 'a' && c <= 'z' || c >= '0' && c <= '9' || c >= 'A' && c <= 'Z';
}
inline bool read_str(char *a) {
  while ((*a = nc()) && need(*a) && rEOF) ++a;
  *a = '\0';
  return rEOF;
}
}  // namespace _
using namespace _;
long long a[200050];
int n, k;
bool check(long long x) {
  long long kk = 0;
  for (int i = (n + 1) / 2; i <= n; i++) kk += max(x - a[i], 0ll);
  if (kk > k)
    return 0;
  else
    return 1;
}
int main() {
  scanf("%d%d", &n, &k);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  sort(a + 1, a + 1 + n);
  long long l = 0, r = 2e9;
  long long ans = 0;
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (check(mid)) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  printf("%lld\n", ans);
  return 0;
}
