#include <bits/stdc++.h>
using namespace std;
int main() {
  const long long int MOD = 1e9 + 7;
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < (int)(M); i++) cin >> a[i];
  vector<int> dp(N + 1, 0);
  auto iter = a.begin();
  for (int i = 0; i < (int)(N + 1); i++) {
    if (*iter == i) {
      iter++;
      continue;
    }
    if (i == 0)
      dp[i] = 1;
    else if (i == 1)
      dp[i] = dp[i - 1];
    else
      dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
  }
  cout << dp[N] << endl;
  return 0;
}
