#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long int llINF = 0x3f3f3f3f3f3f3f;
long long int n, s;
vector<long long int> v;
bool check(long long int val) {
  long long int bebe = 0;
  for (auto x : v) {
    if (x < val) return false;
    bebe += abs(x - val);
  }
  return bebe >= s;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> s;
  long long int tot = 0;
  for (int i = 1; i <= n; i++) {
    long long int x;
    cin >> x;
    v.push_back(x);
    tot += x;
  }
  if (tot < s) {
    cout << -1 << endl;
    return 0;
  }
  sort(v.begin(), v.end());
  long long int ini = 0;
  long long int end = 1e9;
  long long int best = -INF;
  while (ini <= end) {
    long long int mid = (ini + end) >> 1;
    if (check(mid)) {
      best = max(best, mid);
      ini = mid + 1;
    } else
      end = mid - 1;
  }
  cout << best << endl;
}
