#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  vector<long long> nums(n);
  for (int i = 0; i < n; i++) cin >> nums[i];
  sort(nums.begin(), nums.end());
  long long median = nums[n / 2];
  int maxim = k;
  int b = 1;
  for (int i = (n / 2) + 1; i < n; i++) {
    if (k >= (nums[i] - median) * b) {
      k -= (nums[i] - median) * b;
      median = nums[i];
      b++;
    } else
      break;
  }
  median += k / b;
  cout << median;
}
