#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;
  for (int i = 0; i < n + 1; ++i) {
    dp[i] = 1;
  }
  for (int i = 0; i < m; ++i) {
    std::cin >> a;
    dp[a] = 0;
  }
  for (int i = 2; i < n + 1; ++i) {
    if (dp[i] == 0) {
      continue;
    }
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  long long ans = dp[n] % MOD;
  std::cout << ans << std::endl;
}
