#include <bits/stdc++.h>
using namespace std;
const int N = 1000;
int n;
long long int sum, wanted;
int vol[N];
void read() {
  cin >> n >> wanted;
  for (int i = 0; i < n; i++) cin >> vol[i];
}
void init() {
  for (int i = 0; i < n; i++) sum += vol[i];
}
int ans() {
  for (int i = 1; i < n; i++) {
    int dif = vol[i] - vol[0];
    if (wanted <= dif) return vol[0];
    wanted -= dif;
    vol[i] = vol[0];
  }
  long long int q;
  if (wanted % n == 0)
    q = wanted / n;
  else
    q = (wanted / n) + 1;
  return vol[0] - q;
}
int main() {
  read();
  init();
  sort(vol, vol + n);
  if (sum < wanted)
    cout << -1 << endl;
  else
    cout << ans() << endl;
  return 0;
}
