#include <bits/stdc++.h>
using namespace std;
int main(void) {
  long long n, val;
  cin >> n >> val;
  vector<long long> v(n);
  long long minV = LLONG_MAX;
  long long ts = 0;
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
    minV = min(minV, v[i]);
    ts += v[i];
  }
  long long bufSpace = 0;
  for (long long i = 0; i < n; i++) bufSpace += v[i] - minV;
  if (val <= bufSpace) {
    cout << minV << endl;
    return 0;
  }
  if (ts < val) {
    cout << -1 << endl;
    return 0;
  }
  val -= bufSpace;
  while (minV) {
    val -= n;
    minV--;
    if (val <= 0) {
      cout << minV << endl;
      return 0;
    }
  }
}
