#include <bits/stdc++.h>
using namespace std;
long long int gcd(long long int a, long long int b) {
  if (a == 0 || b == 0) return 0;
  if (a == b) return a;
  if (a > b) return gcd(a % b, b);
  return gcd(a, b % a);
}
long long int max(long long int a, long long int b) {
  if (a > b) return a;
  return b;
}
long long int min(long long int a, long long int b) {
  if (a > b) return b;
  return a;
}
long long int dx[4] = {-1, 1, 0, 0};
long long int dy[4] = {0, 0, 1, -1};
long long int ddx[8] = {0, 0, 1, 1, 1, -1, -1, -1};
long long int ddy[8] = {1, -1, 1, -1, 0, 1, -1, 0};
double eps = 0.00000001;
int main() {
  ios_base::sync_with_stdio;
  cin.tie(0);
  cout.tie(0);
  long long int n, s;
  cin >> n >> s;
  long long int arr[n];
  for (long long int i = 0; i < n; i++) cin >> arr[i];
  long long int Max = -00, Min = 999999999999, sum = 0;
  for (long long int i = 0; i < n; i++)
    Min = min(Min, arr[i]), Max = max(Max, arr[i]), sum += arr[i];
  if (s > sum) {
    cout << "-1";
    return 0;
  }
  long long int l = 0, r = Min + 1, mid;
  bool change = true;
  while (l <= r && change) {
    mid = (l + r) / 2;
    long long int extra = 0;
    for (long long int i = 0; i < n; i++) extra += arr[i] - mid;
    if (extra > s) {
      if (l != mid)
        l = mid;
      else
        change = false;
    } else if (extra == s)
      break;
    else {
      if (r != mid)
        r = mid;
      else
        change = false;
    }
  }
  cout << mid;
  int dont_hack_please;
  return 0;
}
