#include <bits/stdc++.h>
using namespace std;
int a[105], n, m;
bool fun(int ans) {
  pair<int, int> b[ans];
  for (int i = 0; i < ans; i++) {
    b[i].first = 0;
    b[i].second = 0;
  }
  int j = 0;
  for (int i = n - 1; i >= 0; i--) {
    b[j].first += max(0, a[i] - b[j].second);
    b[j].second++;
    j = (j + 1) % ans;
  }
  int c = 0;
  for (int i = 0; i < ans; i++) {
    c += b[i].first;
  }
  return c >= m;
}
int bs(int r) {
  int l = 1, ans = -1;
  while (l <= r) {
    int mid = (l + r) / 2;
    if (fun(mid)) {
      ans = mid;
      r = mid - 1;
    } else {
      l = mid + 1;
    }
  }
  return ans;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a + n);
  cout << bs(n);
}
