#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, s, A[1005], sum = 0;
  scanf("%lld", &n), scanf("%lld", &s);
  for (int i = 0; i < n; ++i) {
    scanf("%lld", &A[i]);
    sum += A[i];
  }
  if (sum < s) {
    printf("-1\n");
    return 0;
  }
  sort(A, A + n);
  long long int remainSum = 0;
  for (int i = 0; i < n; ++i) {
    remainSum += (A[i] - A[0]);
  }
  if (s <= remainSum) {
    printf("%lld\n", A[0]);
    return 0;
  }
  s -= remainSum;
  long long int div = s / n;
  long long int rem = s % n;
  if (rem == 0) {
    printf("%lld\n", A[0] - div);
  } else
    printf("%lld\n", A[0] - div - 1);
  return 0;
}
