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