#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int stairNum;
  int brokenNum;
  cin >> stairNum >> brokenNum;
  vector<bool> isSafeStep;
  isSafeStep.assign(stairNum + 1, true);
  for (int i = 0; i < brokenNum; ++i) {
    int n;
    cin >> n;
    isSafeStep[n] = false;
  }
  int answer = 0;
  vector<int> dp(stairNum + 1, 0);
  dp[0] = 1;
  if (isSafeStep[1]) dp[1] = 1;
  for (int i = 2; i <= stairNum; ++i) {
    if (isSafeStep[i + 1]) dp[i] += dp[i - 1];
    if (isSafeStep[i + 2]) dp[i] += dp[i - 2];
    dp[i] %= 1000000007;
  }
  auto output = dp[stairNum];
  cout << output;
}
