#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[103];
int s, sum;
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>());
  for (int i = 2; i <= n; i++) a[i] += a[i - 1];
  for (int i = 1; i <= n; i++) {
    sum = a[i];
    for (int j = i * 2; j <= n; j += i) {
      if (j <= n && a[j] - a[j - 1] >= j / i - 1) {
        sum += a[j] - a[j - i] - j + i;
      }
      if (a[j] - a[j - 1] <= j / i - 1 && j + i <= n) {
        for (int t = j - i + 1; t <= j; t++) {
          if (a[t] - a[t - 1] - j / i + 1 > 0)
            sum += a[t] - a[t - 1] - j / i + 1;
          else
            break;
        }
        break;
      }
      if (j + i > n) {
        j = j + i;
        for (int t = j - i + 1; t <= n; t++) {
          if (a[t] - a[t - 1] - j / i + 1 > 0)
            sum += a[t] - a[t - 1] - j / i + 1;
          else
            break;
        }
        break;
      }
    }
    if (i * 2 > n) sum += a[n] - a[i] - (n - i);
    if (sum >= m) printf("%d", i), exit(0);
  }
  printf("-1");
  return 0;
}
