#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long int s;
  cin >> s;
  long long int arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  long long int smallest = arr[0];
  long long int sum = 0;
  for (int i = 0; i < n; i++) {
    sum = sum + abs(smallest - arr[i]);
  }
  if (sum >= s) {
    cout << smallest;
  } else {
    s = s - sum;
    if (s > n * smallest) {
      cout << "-1";
    } else {
      long long int factor = s / n;
      smallest = smallest - factor;
      if (s % n == 0)
        cout << smallest;
      else
        cout << smallest - 1;
    }
  }
}
