#include <bits/stdc++.h>
int main() {
  int N, M;
  std::cin >> N >> M;
  const long long mod = 1e9 + 7;
  std::vector<bool> a(N + 1, true);
  for (int i = 0; i < M; ++i) {
    int num;
    std::cin >> num;
    a[num] = false;
  }
  std::vector<long long> dp(N + 1);
  for (int i = 0; i < N; ++i) {
    for (int j = i + 1; j <= std::min(i + 2, N); ++j)
      if (a[j]) {
        dp[j] += dp[i];
        dp[j] %= mod;
      }
  }
  std::cout << dp[N] << std::endl;
  return 0;
}
