#include <bits/stdc++.h>
using namespace std;
long long n, s;
long long v[1001];
bool f(long long x) {
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    sum += v[i] - x;
  }
  if (sum >= s) return true;
  return false;
}
int main() {
  cin >> n >> s;
  long long mn = 10e9 + 1, sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
    mn = min(mn, v[i]);
    sum += v[i];
  }
  if (sum < s) {
    cout << -1 << endl;
    return 0;
  }
  long long st = 0, en = mn, ans, mid;
  ans = st;
  while (st <= en) {
    mid = st + (en - st) / 2;
    if (f(mid)) {
      ans = max(ans, mid);
      st = mid + 1;
    } else
      en = mid - 1;
  }
  cout << ans << endl;
  return 0;
}
