#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  long long n, s;
  cin >> n >> s;
  vector<long long> v(n);
  long long base = 0x3f3f3f3f3f3f3f3f;
  long long tot = 0;
  for (auto &i : v) {
    cin >> i;
    base = min(base, i);
    tot += i;
  }
  if (tot < s) return cout << -1 << '\n', 0;
  long long sum = 0;
  for (auto i : v) {
    sum += i - base;
  }
  s -= sum;
  if (s <= 0) return cout << base << '\n', 0;
  cout << base - (((s - 1) / n) + 1) << '\n';
  return 0;
}
