#include <bits/stdc++.h>
using namespace std;
const int Max_n = 200005;
int a[Max_n];
int main() {
  int n, m, sum = 0;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    sum += a[i];
  }
  if (sum < m) {
    printf("-1\n");
    return 0;
  }
  sort(a + 1, a + n + 1, greater<int>());
  for (int days = 1; days <= n; ++days) {
    int ans = 0, cnt = 0, b = 0;
    for (int i = 1; i <= n; i++) {
      ans += (a[i] - cnt);
      if (i % days == 0) {
        cnt++;
      }
      if (ans >= m) {
        b = 1;
        break;
      }
    }
    if (b) {
      printf("%d\n", days);
      break;
    }
  }
  return 0;
}
