#include <bits/stdc++.h>
using namespace std;
long long int i, j, a, k, b, c, n, t = 1, m, p, q, d, e, f, y, g, z, h, r, l, x,
                                   u, ar[10005], br[10005];
long double aa, bb, ee, dd, ff, kk, gg;
vector<long long int> v, s, vv;
vector<pair<long long int, long long int> > ss;
map<long long int, long long int> ta, pa, sa, ma;
map<long long int, vector<pair<long long int, long long int> > > me;
priority_queue<long long int> aq, tq, pq, nq, mq, xq;
string st, et, ft, pt, ct;
deque<long long int> de, ne;
set<long long int> li;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  while (t--) {
    cin >> n >> k;
    for (i = 0; i < n; i++) {
      cin >> a;
      v.push_back(a);
    }
    if (n == 1) {
      cout << v[0] + k << endl;
      continue;
    }
    sort(v.begin(), v.end());
    e = n / 2;
    l = v[e];
    r = 2000000010;
    while (l <= r) {
      m = (l + r) / 2;
      c = 0;
      for (i = e; i < n; i++) {
        c = c + max(0LL, m - v[i]);
      }
      if (c > k)
        r = m - 1;
      else if (c <= k)
        l = m + 1;
    }
    cout << l - 1 << endl;
    v.clear();
  }
}
