#include <bits/stdc++.h>
using namespace std;
int arr[105], n, ans = -1, m;
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  sort(arr, arr + n);
  reverse(arr, arr + n);
  for (int days = 1; days <= m; days++) {
    int currcnt = 0, sub = 0, currans = 0;
    for (int j = 0; j < n; j++) {
      currcnt++;
      currans += max(0, (arr[j] - sub));
      if (currcnt == days) {
        currcnt = 0;
        sub++;
      }
    }
    if (currans >= m) {
      ans = days;
      break;
    }
  }
  cout << ans << "\n";
}
