#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, tmp;
  bool b;
  cin >> n >> m;
  vector<int> t(n, -1);
  while (m--) {
    cin >> tmp;
    t[tmp - 1]++;
  }
  m = 1000;
  for (int i = 0; i < n; i++) {
    m = min(m, t[i]);
  }
  cout << m + 1;
  return 0;
}
