#include <bits/stdc++.h>
using namespace std;
const int N = 100;
int n, m;
int a[N + 10];
vector<int> v[N + 10];
int main() {
  ios::sync_with_stdio(0), cin.tie(0);
  cin >> n >> m;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  sort(a + 1, a + 1 + n);
  reverse(a + 1, a + 1 + n);
  for (int day = 1; day <= n; day++) {
    int cur = 1;
    for (int j = 1; j <= day; j++) v[j].clear();
    for (int j = 1; j <= n; j++) {
      int len = v[cur].size();
      if (len > 0 && a[j] - len <= 0) {
        break;
      }
      v[cur].push_back(a[j]);
      cur++;
      if (cur > day) cur = 1;
    }
    int total = 0;
    for (int j = 1; j <= day; j++) {
      int len = v[j].size();
      for (int l = 0; l < len; l++) {
        int x = v[j][l];
        x -= l;
        total += x;
      }
    }
    if (total >= m) {
      cout << day << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}
