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