#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
const long long SIZE = 100000;
const int INF = 0x3f3f3f3f;
const long long ll_INF = 0x3f3f3f3f3f3f3f3f;
const long double PI = acos(-1);
const long long MAXN = numeric_limits<long long>::max();
const long long MAX = 2000000;
void disp(vector<long long> v) {
  for (auto u : v) cout << u << " ";
  cout << '\n';
}
void solve() {
  long long n, s, tot = 0, x;
  cin >> n >> s;
  vector<long long> v(n);
  for (long long i = 0; i < n; i++) cin >> v[i];
  sort((v).begin(), (v).end());
  for (long long i = 1; i < n; i++) {
    tot += v[i] - v[0];
  }
  if (tot >= s)
    cout << v[0];
  else {
    s -= tot;
    if (s % n == 0)
      x = s / n;
    else
      x = s / n + 1;
    if (x > v[0])
      cout << -1;
    else
      cout << v[0] - x;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
