#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M, A, MOD = 1000000007;
  bool X[100000] = {};
  static long long DP[100010];
  cin >> N >> M;
  for (int i = 0; i < 100000; i++) X[i] = true;
  for (int i = 0; i < M; i++) cin >> A, X[A] = false;
  DP[0] = 1;
  if (X[1])
    DP[1] = 1;
  else
    DP[1] = 0;
  for (int i = 2; i <= N; i++) {
    if (!X[i])
      DP[i] = 0;
    else
      DP[i] = DP[i - 1] + DP[i - 2];
    DP[i] = DP[i] % MOD;
  }
  cout << DP[N];
}
