#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  long long i, j, k, t, mn = 1e13, x, sum = 0, temp, ans, s, n, baki;
  cin >> n >> s;
  vector<long long> vec;
  for (int i = 0; i < n; i++) {
    cin >> x;
    sum += x;
    vec.push_back(x);
    mn = min(mn, x);
  }
  if (sum < s) {
    cout << -1;
    return 0;
  } else {
    k = 0;
    for (int i = 0; i < n; i++) {
      temp = vec[i] - mn;
      k += temp;
    }
    if (k >= s) {
      cout << mn;
      return 0;
    } else {
      baki = s - k;
      j = (baki + n - 1) / n;
      ans = mn - j;
      cout << ans;
    }
  }
}
