#include <bits/stdc++.h>
using namespace std;
long long int n, s, a[111111], sum, minn = 11111111111, m, k;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> s;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    minn = min(minn, a[i]);
    sum += a[i];
  }
  if (sum < s) {
    cout << "-1" << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) m += a[i] - minn;
  if (m > s) {
    cout << minn << endl;
    return 0;
  }
  k = (s - m) / n;
  if ((s - m) % n != 0) k++;
  cout << minn - k;
}
