#include <bits/stdc++.h>
using namespace std;
int mapp[110];
int cmp(int a, int b) { return a > b; }
int main() {
  int n, m;
  int total = 0;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &mapp[i]);
    total += mapp[i];
  }
  if (total < m) {
    printf("-1");
    return 0;
  }
  sort(mapp + 1, mapp + n + 1, cmp);
  int tmp = 0;
  for (int i = 1; i <= n; i++) {
    tmp = 0;
    int num = 0;
    int cnt = 0;
    for (int j = 1; j <= n; j++) {
      if (num > mapp[j]) break;
      cnt++;
      tmp += mapp[j] - num;
      if (cnt == i) {
        num++;
        cnt = 0;
      }
    }
    if (tmp >= m) {
      printf("%d", i);
      break;
    }
  }
  return 0;
}
