#include <bits/stdc++.h>
using namespace std;
const int maxn = 100005;
const int mod = 1e9 + 7;
long long n, a[1005];
long long s;
int ck(long long x) {
  long long minn = x, now = 0, flag = 0;
  for (int i = 1; i <= n; i++) {
    if (a[i] >= x) {
      now += a[i] - x;
    } else {
      flag = 1;
      break;
    }
  }
  if (now < s || flag) return 0;
  return 1;
}
int main() {
  scanf("%lld%lld", &n, &s);
  for (int i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  long long l = 0, r = 1e12 + 1, ans = -1;
  while (l <= r) {
    long long mid = (l + r) >> 1;
    if (ck(mid)) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  printf("%lld\n", ans);
  return 0;
}
