#include <bits/stdc++.h>
using namespace std;
long long n, s;
vector<long long> v(1001);
long long check(long long x) {
  long long sum = 0;
  for (long long i = 0; i < n; i++) {
    if (v[i] < x) return 0;
    sum += max((long long)0, v[i] - x);
  }
  return (sum >= s);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> s;
  for (long long i = 0; i < n; i++) cin >> v[i];
  long long l = 0;
  long long r = 1e15;
  while (l < r) {
    long long mid = (l + r + 1) / 2;
    if (check(mid))
      l = mid;
    else
      r = mid - 1;
  }
  if (check(l))
    cout << l;
  else
    cout << -1;
}
