#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, s;
  long long dp[1100];
  long long sum = 0;
  cin >> n >> s;
  long long minn = 0x3f3f3f3f;
  for (int i = 1; i <= n; i++) {
    cin >> dp[i];
    sum += dp[i];
    minn = min(minn, dp[i]);
  }
  if (sum < s) {
    printf("-1\n");
  } else if (sum == s) {
    printf("0\n");
  } else {
    int ans = (sum - s) / n;
    if (ans < minn) {
      cout << ans << endl;
    } else {
      cout << minn << endl;
    }
  }
}
