#include <bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
int main() {
  int N, M;
  cin >> N >> M;
  std::vector<long long> dp(N + 1);
  std::vector<int> A(N + 1, 0);
  int a;
  for (int i = 1; i <= M; i++) {
    cin >> a;
    A[a] = 1;
  }
  dp[0] = 1;
  if (A[1] == 1)
    dp[1] = 0;
  else
    dp[1] = 1;
  for (int i = 2; i <= N; i++) {
    if (A[i] == 1)
      dp[i] = 0;
    else
      dp[i] = dp[i - 1] + dp[i - 2];
  }
  cout << dp[N] % mod << endl;
  return 0;
}
