#include <bits/stdc++.h>
using namespace std;
const int MAXN = 15;
const long long MOD = 1e9 + 7;
const long long LINF = 0x3f3f3f3f3f3f3f3f;
const int INF = 1e9 + 7;
const double PI = acos(-1.0);
const double EPS = 1e-8;
int _;
using namespace std;
long long num[1005];
long long N, S;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  while (cin >> N >> S) {
    for (int i = 1; i <= N; ++i) cin >> num[i];
    sort(num + 1, num + 1 + N);
    long long togo = 0;
    for (int i = 1; i <= N; ++i) togo += num[i] - num[1];
    S -= togo;
    S = max(S, 0LL);
    if (N * num[1] < S)
      cout << -1 << endl;
    else
      cout << (num[1] - (S / N + (S % N != 0))) << endl;
  }
  return 0;
}
