#include <bits/stdc++.h>
long long int power(long long int x, long long int b) {
  long long int p = 1;
  while (b > 0) {
    if (b & 1) {
      p = p * x;
      p %= 1000000007;
    }
    b >>= 1;
    x *= x;
    x %= 1000000007;
  }
  return p % 1000000007;
}
using namespace std;
struct lex_compare {
  bool operator()(
      const pair<long long int, pair<long long int, long long int> > p1,
      const pair<long long int, pair<long long int, long long int> > p2) {
    return (p1.first == p2.first) ? p1.second.first < p2.second.first
                                  : p1.first > p2.first;
  }
};
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long int n, s;
  cin >> n >> s;
  long long int arr[n];
  long long int sum = 0;
  long long int mint = INT_MAX;
  for (long long int i = 0; i < n; i++) {
    cin >> arr[i];
    sum += arr[i];
    mint = min(arr[i], mint);
  }
  if (sum < s) {
    cout << -1 << "\n";
    return 0;
  } else if (sum == s) {
    cout << 0 << "\n";
    return 0;
  }
  long long int sum2 = sum - n * mint;
  if (sum2 >= s) {
    cout << mint << "\n";
  } else {
    s -= sum2;
    cout << (n * mint - s) / n << "\n";
  }
  return 0;
}
