#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<int> c;
int main() {
  cin >> n >> m;
  c.resize(n);
  for (int i = 0; i < n; i++) cin >> c[i];
  sort(c.rbegin(), c.rend());
  for (int k = 1; k <= n; k++) {
    int sum = 0;
    for (int i = 0; i < n; i++) sum += max(0, c[i] - i / k);
    if (sum >= m) return cout << k, 0;
  }
  cout << -1;
}
