#include <bits/stdc++.h>
using namespace std;
const int INF = 100100100;
const long long INFLL = 1001001001001001001;
const int MOD = (int)1e9 + 7;
const long long MODLL = (long long)1e9 + 7;
const double EPS = 1e-9;
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m);
  for (int i = 0; i < (m); ++i) cin >> a[i];
  vector<bool> flag(n + 1, true);
  for (int i = 0; i < m; i++) {
    flag[a[i]] = false;
  }
  vector<int> dp(n + 1, 0);
  dp[0] = 1;
  for (int i = 1; i <= n + 1; i++) {
    if (flag[i]) {
      dp[i] += dp[i - 1];
      dp[i] %= MOD;
      if (i >= 2) {
        dp[i] += dp[i - 2];
        dp[i] %= MOD;
      }
    } else {
      dp[i] = 0;
    }
  }
  cout << dp[n] << endl;
  return 0;
}
