#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int arr[n + 1];
  for (long long i = (0); i <= (n + 1); i++) arr[i] = 0;
  for (long long i = 0; i < (m); i++) {
    int x;
    cin >> x;
    arr[x] = -1;
  }
  arr[0] = 1;
  if (arr[1] == 0) arr[1] = 1;
  for (long long i = (2); i <= (n); i++) {
    if (arr[i] == -1) continue;
    if (arr[i - 1] != -1) arr[i] += arr[i - 1];
    if (arr[i - 2] != -1) arr[i] += arr[i - 2];
  }
  cout << arr[n];
  cout << endl;
  return 0;
}
