#include <bits/stdc++.h>
using namespace std;
long long n, s, a[1010], sum, mim = 0x3f3f3f3f, l, r, mid, ans = 0;
int can(long long x) { return (sum - n * x >= s ? 1 : 0); }
int main() {
  cin >> n >> s;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    sum += a[i];
    mim = min(mim, a[i]);
  }
  if (sum < s) {
    cout << -1;
    return 0;
  }
  l = 0;
  r = mim;
  while (l <= r) {
    mid = (l + r) / 2;
    if (can(mid)) {
      l = mid + 1;
      ans = max(ans, mid);
    } else
      r = mid - 1;
  }
  cout << ans << endl;
  return 0;
}
