#include <bits/stdc++.h>
using namespace std;
int main() {
  const int MOD = 1000000007;
  int N, M, a[M];
  cin >> N >> M;
  for (int i = 0; i < M; i++) cin >> a[i];
  vector<int> dp(N + 1, 1);
  for (int i = 0; i < M; i++) dp[a[i]] = 0;
  for (int i = 2; i <= N; i++) {
    if (dp[i] != 0) dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
  }
  cout << dp[N] << endl;
  return 0;
}
