#include <bits/stdc++.h>
using namespace std;
int n, m, a[105];
bool check(int x) {
  int cnt = 0, ans = 0, c = 0, i, k = 0;
  for (i = 0; i < n / x; ++i) {
    for (int j = 0; j < x; ++j, ++k) {
      ans += max(0, a[k] - cnt);
    }
    ++cnt;
  }
  for (; k < n; ++k) {
    ans += max(0, a[k] - cnt);
  }
  return ans >= m;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
  }
  sort(a, a + n, greater<int>());
  for (int i = 1; i <= n; ++i) {
    if (check(i)) {
      printf("%d\n", i);
      return 0;
    }
  }
  printf("-1\n");
  return 0;
}
