#include <bits/stdc++.h>
using namespace std;
int mem[100000] = {};
int counts(int s[], int i, int j, int d) {
  if (mem[i]) return mem[i];
  if (binary_search(s, s + j, i)) return 0;
  if (i >= d) return 0;
  if (i == d - 1) return 1;
  mem[i] = counts(s, i + 1, j, d) + counts(s, i + 2, j, d);
  return mem[i];
}
int main() {
  int n, m;
  cin >> n >> m;
  int a[m];
  for (int i = 0; i < m; i++) cin >> a[i];
  cout << counts(a, 0, m, n);
  return 0;
}
