#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <cstring>
#include <map>
#include <set>
#include <queue>
#include <math.h>
#include <algorithm>

using namespace std;
int main()
{
  int N, M;
  cin >> N >> M;
  vector<int> stop(N+1, 0);
  for (int i=0;i<M;i++) {
    int a;
    cin >> a;
    stop[a] = 1;
  }
  vector<long long> ans(N+1, 0);
  ans[0] = 1;
  for (int i=0;i<N;i++) {
    if (stop[i] == 1) continue;
    if (stop[i+1] == 0) {
      ans[i+1] += ans[i];
    }
    if (i+2 <= N && stop[i+2] == 0) {
      ans[i+2] += ans[i];
    }
  }
  long long modV = 1'000'000'007;
  cout << ans[N] % modV << endl;
  return 0;
}
