#include <bits/stdc++.h>
using namespace std;
long long a[10001], minn = 0x7fffffff, sum = 0, n, s;
long long fmin(long long k1, long long k2) {
  if (k1 < k2)
    return k1;
  else
    return k2;
}
int main() {
  scanf("%lld%lld", &n, &s);
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
    minn = fmin(minn, a[i]);
    sum += a[i];
  }
  sum -= s;
  if (sum < 0) {
    printf("-1\n");
    return 0;
  }
  if (minn * n >= sum)
    printf("%lld\n", sum / n);
  else
    printf("%lld\n", minn);
  return 0;
}
