#include <bits/stdc++.h>
using namespace std;
int n;
int v[1005];
long long s, sum;
bool cmp(int x, int y) { return x > y; }
int main() {
  scanf("%d %lld", &n, &s);
  for (int i = 1; i <= n; i++) scanf("%d", &v[i]), sum += v[i];
  if (sum < s) {
    printf("-1\n");
    return 0;
  }
  sort(v + 1, v + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    long long vi = (long long)i * (v[i] - v[i + 1]);
    if (s > vi)
      s -= vi;
    else {
      if (i == n)
        printf("%d\n", v[i] - (s + i - 1) / i);
      else
        printf("%d\n", v[n]);
      return 0;
    }
  }
}
