#include <bits/stdc++.h>
int main() {
  const long long MOD = 1000000007;
  long long m, n;
  int a;
  std::cin >> n >> m;
  std::vector<bool> b(n + 1, false);
  std::vector<long long> dp(n + 1);
  for (int i = 0; i < m; i++) {
    std::cin >> a;
    b[a] = true;
  }
  dp[0] = 1;
  if (b[1])
    dp[1] = 0;
  else
    dp[1] = 1;
  for (int i = 2; i <= n; i++) {
    if (b[i])
      dp[i] = 0;
    else
      dp[i] = dp[i - 1] + dp[i - 2];
  }
  std::cout << dp[n] % MOD << std::endl;
  return 0;
}
