#include <bits/stdc++.h>
int main() {
  int n = 0;
  long long s = 0;
  scanf("%d %lld", &n, &s);
  long long kegs[n];
  memset(kegs, 0, sizeof(kegs));
  long long least = -1;
  for (int i = 0; i < n; i++) {
    int v = 0;
    scanf("%d", &v);
    kegs[i] = v;
    least = (v < least || least == -1) ? v : least;
  }
  long long container = 0;
  long long total = 0;
  for (long long x : kegs) {
    container += (x - least);
    total += x;
  }
  if (s > total) {
    printf("%d\n", -1);
    return 0;
  }
  while (container < s) {
    container += n;
    least--;
  }
  printf("%lld\n", least);
}
