#include <bits/stdc++.h>
using namespace std;
int n;
long long int s, sum = 0, mn = 1e9 + 9;
vector<long long int> arr(1e3 + 3);
int main(void) {
  ios ::sync_with_stdio(0);
  cin.tie(0);
  cin >> n >> s;
  for (int i = 1; i <= n; ++i) {
    cin >> arr[i];
    sum += arr[i];
    mn = min(mn, arr[i]);
  }
  if (sum < s) {
    cout << -1 << "\n";
    return 0;
  }
  sum = 0;
  for (int i = 1; i <= n; ++i) {
    sum += arr[i] - mn;
  }
  if (sum >= s) {
    cout << mn << "\n";
    return 0;
  }
  s -= sum;
  mn -= s / n;
  if (s % n != 0) {
    --mn;
  }
  cout << mn << "\n";
  return 0;
}
