#include <bits/stdc++.h>
using namespace std;
int a[1000];
int main(void) {
  int n, m;
  int i, j, k;
  int s;
  scanf("%d %d", &n, &m);
  for (i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a, a + n + 1);
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      for (k = j, s = 0; k <= n; k++) s += max(0, a[k] - ((k - j) / i));
      if (m <= s) {
        printf("%d\n", i);
        return 0;
      }
    }
  }
  puts("-1");
  return 0;
}
