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