#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  long long n, ans = 0, acum = 0, s, tonel;
  cin >> n >> s >> ans;
  acum = ans;
  for (int i = 1; i < n; ++i) {
    cin >> tonel;
    acum += tonel;
    ans = min(ans, tonel);
  }
  if (acum < s)
    ans = -1;
  else if (acum == s)
    ans = 0;
  else {
    s -= (acum - ans * n);
    while (s > 0) {
      ans--;
      s -= n;
    }
  }
  cout << ans << "\n";
  return 0;
}
