#include <bits/stdc++.h>
using namespace std;
long long powerm(long long x, unsigned long long y, long long p) {
  long long res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long power(long long x, unsigned long long y) {
  if (y == 0)
    return 1;
  else if (y % 2 == 0)
    return power(x, y / 2) * power(x, y / 2);
  else
    return x * power(x, y / 2) * power(x, y / 2);
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long gcdExtended(long long a, long long b, long long *x, long long *y) {
  if (a == 0) {
    *x = 0, *y = 1;
    return b;
  }
  long long x1, y1;
  long long gcd = gcdExtended(b % a, a, &x1, &y1);
  *x = y1 - (b / a) * x1;
  *y = x1;
  return gcd;
}
long long modInverse(long long a, long long m) {
  long long x, y;
  long long g = gcdExtended(a, m, &x, &y);
  if (g != 1)
    cout << "Inverse doesn't exist";
  else {
    long long res = (x % m + m) % m;
    return res;
  }
}
int32_t main() {
  long long q = 1;
  long long Q = 1;
  while (q--) {
    long long n, k;
    cin >> n >> k;
    long long a[n];
    long long mx = 0;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      mx = max(mx, a[i]);
    }
    sort(a, a + n);
    long long l = a[n / 2];
    long long h = mx + k;
    long long ans = l;
    while (l <= h) {
      long long mid = (l + h) / 2;
      long long f = 0, k1 = k;
      if (mid - a[n / 2] <= k) {
        k1 = k - mid + a[n / 2];
        f = 1;
      }
      long long s = 0;
      if (f == 1) {
        for (long long i = n / 2 + 1; i < n; i++) {
          if (a[i] < mid) {
            s += mid - a[i];
          } else
            break;
        }
      }
      long long b = 0;
      if (s <= k1 && f == 1) {
        b = 1;
      }
      if (b == 1) {
        ans = mid;
        l = mid + 1;
      } else
        h = mid - 1;
    }
    cout << ans;
  }
}
