#include <bits/stdc++.h>
const int MAX_N_INDEX = 100000 + 1;
std::array<unsigned long long int, MAX_N_INDEX> dp;
const int MAX_M = MAX_N_INDEX - 1;
std::array<int, MAX_M> broken_stair;
const int MOD_UNIT = 1e9 + 7;
int main() {
  int N, M;
  std::cin >> N >> M;
  for (int i = 0; i < M; i++) {
    int index;
    std::cin >> index;
    broken_stair[index] = true;
  }
  dp[0] = 1;
  dp[1] = broken_stair[1] ? 0 : 1;
  for (int i = 2; i <= N; i++) {
    if (broken_stair[i]) {
      dp[i] = 0;
    } else {
      dp[i] = (dp[i - 1] + dp[i - 2]) % MOD_UNIT;
    }
  }
  printf("%llu\n", dp[N]);
}
