#include <bits/stdc++.h>
using namespace std;
long long n, i, a, s, t, m = 2e9;
int main() {
  for (cin >> n >> s; i < n; i++) cin >> a, t += a, m = min(m, a);
  if (t < s) return cout << -1, 0;
  if (t - m * n < s) return cout << (t - s) / n, 0;
  cout << m;
}
