#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
signed main() {
  long long a, b;
  cin >> a >> b;
  vector<long long> c(b);
  for (long long i = 0; i < b; i++) cin >> c[i];
  long long dp[100010];
  for (long long i = 0; i < 100010; i++) dp[i] = 1e10;
  dp[0] = 1;
  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;
  }
  if (d[0] == false) {
    dp[1] = 0;
  } else
    dp[1] = 1;
  for (long long i = 2; i <= a; i++) {
    if (d[i] == false) {
      dp[i] = 0;
    } else
      dp[i] = (dp[i - 1] + dp[i - 2]) % 1000000009;
  }
  cout << dp[a] % 1000000007 << endl;
}
