#include <bits/stdc++.h>
using namespace std;
bool comp(pair<int, int> &a, pair<int, int> &b) {
  if (a.second == b.second)
    return a.first < b.first;
  else
    return a.second < b.second;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int N;
  long long S;
  cin >> N >> S;
  vector<long long> a(N);
  long long sum1 = 0ll, sum2 = 0ll;
  for (int i = 0; i < N; ++i) {
    cin >> a[i];
    sum1 += a[i];
  }
  if (sum1 < S) {
    cout << -1;
    return 0;
  }
  sort(a.begin(), a.end());
  for (int i = 0; i < N; ++i) {
    sum2 += a[i] - a[0];
  }
  if (sum2 >= S) {
    cout << a[0];
    return 0;
  }
  S -= sum2;
  cout << a[0] - ((S - 1ll) / (long long)N + 1ll);
  return 0;
  return 0;
}
