#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, s, sum = 0, count = 0, k, t = 0, p, i, j;
  cin >> n >> s;
  long long int a[n];
  for (i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  if (sum < s)
    cout << "-1";
  else {
    sort(a, a + n);
    p = 0;
    k = a[0];
    for (i = 1; i < n; i++) {
      if (a[i] > k) {
        if (p <= s) {
          j = a[i] - k;
          a[i] = k;
          p += j;
        } else {
          t = 1;
          break;
        }
      } else
        continue;
    }
    if (t == 1)
      cout << a[0];
    else if (s <= p) {
      cout << a[0];
    } else {
      if (s - p <= n)
        cout << a[0] - 1;
      else {
        i = 0;
        while ((s - p - n * i) > 0) {
          count++;
          i++;
        }
        cout << a[0] - i;
      }
    }
  }
}
