#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long i, j, flag = 0;
  long long n, s;
  cin >> n >> s;
  long long a[n], sum = 0;
  for (i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  if (sum < s) {
    cout << "-1\n";
    return;
  }
  sort(a, a + n);
  while (s != 0) {
    long long p = a[n - 1] - a[0];
    if (p < s) {
      s -= p;
      a[n - 1] = a[0];
    } else {
      a[n - 1] -= s;
      s = 0;
    }
    sort(a, a + n);
    if (a[n - 1] == a[0]) break;
  }
  if (a[n - 1] == a[0]) {
    long long p = s / n, q = s % n;
    for (i = 0; i < n; i++) a[i] -= p;
    sort(a, a + n);
    if (q > 0)
      cout << a[0] - 1 << endl;
    else
      cout << a[0] << endl;
  } else
    cout << a[0] << endl;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
