#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, M, res;
  cin >> N >> M;
  long long dp[N + 1];
  std::memset(dp, 0, sizeof dp);
  bool dan[M + 1];
  std::memset(dan, true, sizeof dan);
  long long tmp;
  for (long long i = 0; i < (M); i++) {
    cin >> tmp;
    dan[tmp] = false;
  }
  dp[0] = 1;
  if (dan[1] == true) dp[1] = 1;
  for (long long i = 2; i <= N; i++) {
    if (dan[i - 1] == true) dp[i] += dp[i - 1];
    if (dan[i - 2] == true) dp[i] += dp[i - 2];
  }
  dp[N] = dp[N] % 1000000007;
  cout << dp[N] << endl;
  return 0;
}
