#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, M, input;
  vector<pair<long long, long long> > pack;
  vector<long long> food(110, 0);
  cin >> N >> M;
  for (long long i = 0; i < M; i++) {
    cin >> input;
    food[input]++;
  }
  for (long long i = 0; i < 101; i++)
    if (food[i]) pack.push_back(make_pair(food[i], 0));
  while (N--) {
    long long idx = 0, bigger = 0;
    for (long long i = 0; i < pack.size(); i++) {
      long long days;
      if (pack[i].second)
        days = pack[i].first / (pack[i].second + 1);
      else
        days = pack[i].first;
      if (days > bigger) {
        bigger = days;
        idx = i;
      }
    }
    pack[idx].second++;
  }
  long long ans = INT_MAX;
  for (long long i = 0; i < pack.size(); i++)
    if (pack[i].second) ans = min(ans, pack[i].first / pack[i].second);
  if (ans == INT_MAX)
    cout << -1 << endl;
  else
    cout << ans << endl;
  return 0;
}
