#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int left, right, mid, sum = 0, cup, page, data[105];
  scanf("%d%d", &cup, &page);
  for (int i = 0; i < cup; i++) {
    scanf("%d", &data[i]);
    sum += data[i];
  }
  if (sum < page) {
    printf("-1\n");
    return 0;
  }
  sort(data, data + cup, greater<int>());
  left = 1;
  right = cup;
  while (left < right) {
    mid = (left + right) / 2;
    sum = 0;
    for (int i = 0; i < cup; i++) sum += max(data[i] - i / mid, 0);
    if (sum >= page)
      right = mid;
    else
      left = mid + 1;
  }
  printf("%d\n", left);
  return 0;
}
