#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long int n = 0, k = 0, sum = 0;
  cin >> n >> k;
  long long int arr[n];
  for (int a = 0; a < n; a++) cin >> arr[a];
  sort(arr, arr + n);
  for (int a = 0; a < n; a++) sum += arr[a] - arr[0];
  cout << max(arr[0] - (max(k - sum, 0ll) / n +
                        (max(k - sum, 0ll) % n != 0 ? 1ll : 0ll)),
              -1ll);
}
