#include <bits/stdc++.h>
using namespace std;
int a[4];
int main() {
  int n, i, j;
  long long s, sum = 0, min = 1000000010, v, temp;
  cin >> n >> s;
  for (i = 0; i < n; i++) {
    cin >> v;
    if (v < min) min = v;
    sum += v;
  }
  if (sum < s)
    cout << -1 << endl;
  else {
    temp = min * n;
    if ((sum - temp) >= s)
      cout << min << endl;
    else {
      s -= (sum - temp);
      temp = s / n;
      if (s % n) temp++;
      cout << min - temp << endl;
    }
  }
  return 0;
}
