#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, M, u;
  long int modulo = 1000000007;
  vector<int> un_used;
  cin >> N >> M;
  vector<long int> dp(N + 1, 0);
  dp[0] = 1;
  for (int i = 0; i < M; i++) {
    int input;
    cin >> input;
    un_used.push_back(input);
  }
  u = 0;
  if (1 != un_used[u]) {
    dp[1] = dp[0];
    dp[1] %= modulo;
  } else {
    u++;
  }
  for (int i = 2; i <= N; i++) {
    if (i != un_used[u]) {
      dp[i] = dp[i - 2] + dp[i - 1];
      dp[i] %= modulo;
    } else if (u < M) {
      u++;
    }
  }
  cout << dp[N];
  return 0;
}
