#include <bits/stdc++.h>
using namespace std;
long long a[10001];
int main() {
  long long n, s;
  cin >> n >> s;
  int Min = INT_MAX;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    if (a[i] < Min) Min = a[i];
  }
  long long sum = 0;
  for (int i = 1; i <= n; i++) {
    sum += (a[i] - Min);
  }
  if (sum >= s) cout << Min, exit(0);
  for (int i = 1; true; i++) {
    sum += n;
    Min--;
    if (sum >= s) cout << Min, exit(0);
    if (Min == 0) cout << -1, exit(0);
  }
}
