#include <bits/stdc++.h>
using namespace std;
long long n, s, res, a[1001001], mx, mxi, m, req, cur;
int main() {
  cin >> n >> req;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    s += a[i];
  }
  if (s < req) {
    cout << -1;
    return 0;
  }
  sort(a, a + n);
  for (int i = 1; i < n; i++) {
    cur += (a[i] - a[0]);
  }
  if (cur < req) {
    long long v = req - cur;
    long long res = v / n;
    if (v % n != 0) res++;
    a[0] = a[0] - res;
  }
  cout << a[0];
  return 0;
}
