#include <bits/stdc++.h>
using namespace std;
bool Check(unsigned int N, int pos) { return (bool)(N & (1LL << pos)); }
long long Set(unsigned int N, int pos) { return N = N | (1LL << pos); }
long long a[1005], dp[105][10005];
long long fn(long long pos, long long n, long long m) {
  if (m <= 0) {
    return 0;
  }
  if (pos > n) {
    if (m > 0) return 1999999999;
    return 0;
  }
  long long &z = dp[pos][m];
  if (z != -1) return z;
  z = 1999999999;
  for (long long i = 1; i <= n - pos + 1; i++) {
    long long x = a[pos + i - 1] - a[pos - 1] - ((i * (i - 1)) / 2);
    z = min(z, 1 + fn(pos + i, n, m - x));
  }
  return z;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int ii, i, j, n, k, m, z = 0, c = 0, t, x, y, l, r, mid;
  memset(dp, -1, sizeof(dp));
  scanf("%lld", &n);
  scanf("%lld", &m);
  for (i = 1; i <= n; i++) {
    scanf("%lld", &a[i]);
  }
  sort(a + 1, a + n + 1);
  reverse(a + 1, a + n + 1);
  for (i = 1; i <= n; i++) {
    a[i] += a[i - 1];
  }
  z = fn(1, n, m);
  if (z == 1999999999) z = -1;
  cout << z << endl;
}
