#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long a, b;
  cin >> a >> b;
  vector<long long> c(b);
  for (long long i = 0; i < b; i++) cin >> c.at(i);
  bool d[100010];
  for (long long i = 0; i < 100010; i++) d[i] = true;
  for (long long i = 0; i < b; i++) {
    d[c.at(i)] = false;
  }
  long long dp[100020];
  dp[0] = 1;
  if (d[1] == true) {
    dp[1] = 1;
  } else
    dp[1] = 0;
  for (long long i = 2; i <= a; i++) {
    if (d[i] == false) {
      dp[i] = 0;
    } else {
      dp[i] = dp[i - 2] + dp[i - 1];
    }
  }
  cout << dp[a] % 1000000007 << endl;
}
