#include <bits/stdc++.h>
using namespace std;
int n, m, x, sum, s, k, cnt;
int a[1000];
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  sort(a + 1, a + n + 1, greater<int>());
  sum = 0;
  for (int i = 1; i <= n; i++) {
    sum += a[i];
    s = sum;
    cnt = 0;
    for (int j = i + 1; j <= n; j++) {
      cnt++;
      if (cnt / i < 1.0 * cnt / i)
        k = cnt / i + 1;
      else
        k = cnt / i;
      if (a[j] - k <= 0) break;
      s += a[j] - k;
    }
    if (s >= m) printf("%d", i), exit(0);
  }
  printf("-1");
  return 0;
}
