#include <bits/stdc++.h>
template <class T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  int N, M;
  std::cin >> N >> M;
  int a[M];
  for (int i = 0; i < M; i++) std::cin >> a[i];
  int m = 0;
  int NUM_MAX = 100010;
  long long dp[NUM_MAX];
  dp[0] = 1;
  if ((M == 0) || (a[m] != 1)) {
    dp[1] = 1;
  } else {
    dp[1] = 0;
    m++;
  }
  for (int i = 2; i <= N; i++) {
    if ((M >= m) && (i == a[m])) {
      dp[i] = 0;
      m++;
    } else {
      dp[i] = dp[i - 1] + dp[i - 2];
    }
  }
  for (int i = 0; i <= N; i++) std::cerr << dp[i] << std::endl;
  std::cout << dp[N] % 1000000007LL << std::endl;
  return 0;
}
