#include <bits/stdc++.h>
using namespace std;
const int maxn = 1100;
long long arr[maxn];
int n;
long long s;
int check(long long ck) {
  long long cur_sum = 0;
  for (int i = 1; i <= n; i++) {
    if (arr[i] < ck) return 0;
    cur_sum += (arr[i] - ck);
  }
  return cur_sum >= s;
}
int main() {
  long long sum = 0;
  scanf("%d%I64d", &n, &s);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &arr[i]);
    sum += arr[i];
  }
  long long l = 0, r = sum, m;
  long long ret = -1;
  while (l <= r) {
    m = (l + r) >> 1;
    if (check(m)) {
      l = m + 1;
      ret = m;
    } else {
      r = m - 1;
    }
  }
  printf("%I64d\n", r);
  return 0;
}
