#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void read(T& x) {
  int f = 0, c = getchar();
  x = 0;
  while (!isdigit(c)) f |= c == '-', c = getchar();
  while (isdigit(c)) x = x * 10 + c - 48, c = getchar();
  if (f) x = -x;
}
template <typename T, typename... Args>
inline void read(T& x, Args&... args) {
  read(x);
  read(args...);
}
template <typename T>
void write(T x) {
  if (x < 0) x = -x, putchar('-');
  if (x > 9) write(x / 10);
  putchar(x % 10 + 48);
}
template <typename T>
void writes(T x) {
  write(x);
  putchar(' ');
}
template <typename T>
void writeln(T x) {
  write(x);
  puts("");
}
template <typename T>
inline bool chkmin(T& x, const T& y) {
  return y < x ? (x = y, true) : false;
}
template <typename T>
inline bool chkmax(T& x, const T& y) {
  return x < y ? (x = y, true) : false;
}
const int maxn = (int)2e5 + 10;
const long long inf = (long long)1e18;
const int mod = (int)1e9 + 7;
long long n, s, v[1005], sum, mx, mn = 1e9 + 1;
bool check(long long m) {
  long long res = 0;
  for (int i = (0); i < (n); i++) {
    res += v[i] - m;
  }
  return res >= s;
}
int main() {
  read(n, s);
  for (int i = (0); i < (n); i++)
    read(v[i]), chkmin(mn, v[i]), chkmax(mx, v[i]), sum += v[i];
  if (sum < s) return puts("-1"), 0;
  long long l = 0, r = mn, m = l + r >> 1;
  while (r - l > 1) {
    m = l + r >> 1;
    if (check(m)) {
      l = m;
    } else {
      r = m;
    }
  }
  if (check(r))
    writes(r);
  else if (check(m))
    writes(m);
  else
    writes(l);
}
