#include <bits/stdc++.h>
using namespace std;
long long n, s;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  t = 1;
  while (t--) {
    cin >> n >> s;
    vector<long long> v(n);
    long long sum = 0;
    long long mini = INT_MAX;
    for (long long i = 0; i < n; i++) {
      cin >> v[i];
      sum += v[i];
      mini = min(mini, v[i]);
    }
    if (sum < s) {
      cout << -1;
      continue;
    }
    sum = 0;
    for (long long i = 0; i < n; i++) {
      sum += (v[i] - mini);
    }
    if (sum >= s) {
      cout << mini;
      continue;
    }
    s -= sum;
    long long ans = mini;
    while (s > 0) {
      s -= n;
      ans--;
    }
    cout << ans;
  }
  return 0;
}
