#include <bits/stdc++.h>
using namespace std;
long long num[1005];
int main() {
  long long n, k;
  while (~scanf("%lld%lld", &n, &k)) {
    long long minn = 0x3f3f3f3f, sum = 0;
    for (int i = 0; i < n; i++) {
      scanf("%lld", &num[i]);
      minn = min(minn, num[i]);
      sum += num[i];
    }
    if (sum < k)
      printf("-1\n");
    else if (sum == k)
      printf("0\n");
    else {
      long long ans = 0;
      for (int i = 0; i < n; i++) ans += num[i] - minn;
      if (ans >= k)
        printf("%lld\n", minn);
      else {
        long long tmp = ceil((k - ans) * 1.0 / n);
        printf("%lld\n", minn - tmp);
      }
    }
  }
  return 0;
}
