#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a[i];
  }
  vector<long long> dp(n + 1);
  dp[0] = 1;
  vector<bool> ok(n, true);
  for (int i = 0; i < n; i++) {
    if (a[i]) {
      ok[a[i]] = false;
    }
  }
  for (int i = 1; i <= n; i++) {
    if (ok[i]) {
      dp[i] += dp[i - 1];
      dp[i] %= mod;
      if (i >= 2) dp[i] += dp[i - 2];
      dp[i] %= mod;
    }
  }
  cout << dp[n] << endl;
  return 0;
}
