#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, s, k = 0, m;
  cin >> n >> s;
  int ar[n];
  for (long long j = 0; j < n; j++) {
    cin >> ar[j];
    k = k + ar[j];
  }
  m = *min_element(ar, ar + n);
  if (k < s)
    cout << "-1";
  else {
    for (long long j = 0; j < n; j++) {
      s -= (ar[j] - m);
    }
    if (s <= 0)
      cout << m;
    else
      cout << (m - (s + n - 1) / n);
  }
  return 0;
}
