#include <bits/stdc++.h>
int main() {
  int n;
  long long s;
  long long a[1005];
  scanf("%d%lld", &n, &s);
  int i, j;
  long long min = 1e9;
  long long Sum = 0;
  int flag = 0;
  for (i = 0; i < n; i++) {
    scanf("%lld", &a[i]);
    if (a[i] < min) min = a[i];
    Sum += a[i];
  }
  if (s > Sum) flag = 2;
  long long sum = 0;
  for (i = 0; i < n; i++) {
    sum += a[i] - min;
    if (sum > s) {
      flag = 1;
      break;
    }
  }
  if (flag == 2)
    printf("-1\n");
  else if (flag)
    printf("%lld\n", min);
  else {
    s = s - sum;
    if (s % n == 0) {
      min = min - s / n;
    } else {
      min = min - s / n - 1;
    }
    printf("%lld\n", min);
  }
}
