#include <bits/stdc++.h>
using namespace std;
const long long int INF = 1e18;
const int inf = 1e9;
const int MOD = 1e9 + 7;
const int nax = 1000000 + 10;
long long int n, arr[nax];
int main() {
  long long int s;
  cin >> n >> s;
  long long int mini = INF, tot = 0, left = 0;
  for (int i = 1; i <= n; i++)
    cin >> arr[i], tot += arr[i], mini = min(mini, arr[i]);
  for (int i = 1; i <= n; i++) left += abs(arr[i] - mini);
  if (tot < s) return cout << -1, 0;
  if (left > s) return cout << mini, 0;
  int dec = (s - left + n - 1) / n;
  cout << mini - dec << "\n";
  return 0;
}
