#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, M;
  cin >> N >> M;
  vector<bool> oks(M, true);
  for (int i = 0; i < M; i++) {
    int a;
    cin >> a;
    oks[a] = false;
  }
  vector<int> dp(N + 1);
  dp[0] = 1;
  for (int now = 0; now < N; now++) {
    for (int next = now + 1; next < min(now + 3, N + 1); next++) {
      if (oks[next] == true) {
        dp[next] += dp[now];
        dp[next] %= 1000000007;
      }
    }
  }
  cout << dp[N] << endl;
  return 0;
}
