#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m;
  cin >> n >> m;
  long long int a[n];
  long long int minn = INT_MAX;
  long long int sum = 0;
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
    if (a[i] < minn) minn = a[i];
    sum += a[i];
  }
  long long int x = minn * n;
  long long int y = sum - x;
  if (sum < m)
    cout << "-1" << endl;
  else {
    if (y >= m)
      cout << minn << endl;
    else {
      m = m - y;
      long long int z = ceil(m * 1.0 / n);
      cout << minn - z << endl;
    }
  }
}
