#include <bits/stdc++.h>
using namespace std;
template <class T>
T abs(T x) {
  if (x < 0) return -x;
  return x;
}
template <class T>
T sqr(T a) {
  return a * a;
}
const double pi = acos(-1.0);
const double eps = 1e-8;
long long i, j, mn, x, z, sum, ar[100010], n, s;
int main() {
  while (2 == scanf("%lld%lld", &n, &s)) {
    mn = 1e18;
    sum = 0LL;
    for (i = 0; i < n; i++) {
      scanf("%lld", &x);
      mn = min(mn, x);
      sum += x;
    }
    x = sum - (n * mn);
    if (x >= s)
      printf("%lld\n", mn);
    else {
      sum = sum - s;
      if (sum < 0)
        printf("-1\n");
      else {
        mn = sum / n;
        printf("%lld\n", mn);
      }
    }
  }
  return 0;
}
