#include <bits/stdc++.h>
using namespace std;
long long a[1003];
int main() {
  long long n, s;
  cin >> n >> s;
  long long miner = 0x3f3f3f3f3f3f3f3f;
  long long sumer = 0;
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
    sumer += a[i];
    miner = min(miner, a[i]);
  }
  if (sumer < s) {
    cout << "-1" << endl;
    return 0;
  }
  sumer = 0;
  for (long long i = 0; i < n; i++) {
    sumer += a[i] - miner;
    a[i] = miner;
  }
  if (sumer >= s) {
    cout << miner << endl;
  } else {
    long long need = s - sumer;
    miner -= need / n;
    if (need % n != 0) {
      miner--;
    }
    cout << miner << endl;
  }
  return 0;
}
