#include <bits/stdc++.h>
int n, a[1001], mn = 1e9;
long long s, cnt = 0;
signed main() {
  scanf("%d %lld", &n, &s);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    if (mn > a[i]) mn = a[i];
  }
  for (int i = 1; i <= n; i++) {
    cnt += a[i] - mn;
  }
  printf("%lld",
         (cnt >= s ? mn
                   : (mn >= (s - cnt) / n + ((s - cnt) % n == 0 ? 0 : 1)
                          ? mn - (s - cnt) / n - ((s - cnt) % n == 0 ? 0 : 1)
                          : -1)));
}
