#include <bits/stdc++.h>
using namespace std;
int main() {
  long N, M;
  cin >> N >> M;
  vector<long> St(M);
  for (int i = 0; i < M; i++) cin >> St[i];
  vector<long> dp(100100, 0);
  int mark = 0;
  for (int i = 0; i < 2; i++) {
    if (i == St[mark]) {
      mark++;
      dp[i] = 0;
    } else
      dp[i] = 1;
  }
  for (int i = 2; i <= N; i++) {
    if (i == St[mark]) {
      mark++;
      dp[i] = 0;
    } else
      dp[i] += (dp[i - 1] + dp[i - 2]) % 1000000007;
  }
  cout << dp[N] << endl;
}
