#include <bits/stdc++.h>
using namespace std;
const int N = 1123;
long long v[N];
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  long long n;
  cin >> n;
  long long s;
  cin >> s;
  for (int i = 0; i < n; i++) cin >> v[i];
  long long sum = 0, mn = LLONG_MAX;
  for (int i = 0; i < n; i++) {
    mn = min(mn, v[i]);
    sum += v[i];
  }
  if (sum < s) {
    cout << -1 << endl;
    return 0;
  }
  long long cur = 0;
  for (int i = 0; i < n; i++) {
    cur += v[i] - mn;
    v[i] = mn;
  }
  if (cur >= s) {
    cout << mn << endl;
    return 0;
  }
  cout << mn - (s - cur + n - 1) / n << endl;
  return 0;
}
