#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.1415926535897932384626433;
const long long M = 998244353;
long long n, a[200100], t, p, k, g;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> k;
  for (long long i = 0; i < n; i++) cin >> a[i];
  sort(a, a + n);
  g = n / 2;
  p = a[g];
  t = 1;
  for (long long i = g + 1; i < n; i++) {
    if ((a[i] - p) * t <= k) {
      k -= (a[i] - p) * t;
      p = a[i];
      t++;
    } else
      break;
  }
  if (k > 0) p += (long long)(k / t);
  cout << p;
}
