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