#include <bits/stdc++.h>
using namespace std;
int n;
long long s;
long long a[1003];
int main() {
  scanf("%d%lld", &n, &s);
  for (int i = 1; i <= n; i++) scanf("%lld", a + i);
  int flag = 0;
  sort(a + 1, a + 1 + n);
  long long temp = 0;
  for (int i = n; i >= 1; i--) {
    temp += a[i];
  }
  if (temp < s) {
    printf("-1\n");
    return 0;
  }
  temp = 0;
  for (int i = n; i >= 2; i--) {
    temp += a[i] - a[1];
  }
  if (temp < s) {
    temp = s - temp;
    temp = temp / n + (temp % n != 0);
    a[1] -= temp;
  }
  printf("%lld\n", a[1]);
  return 0;
}
