#include <bits/stdc++.h>
using namespace std;
constexpr long long int INFLL = 1001001001001001LL;
constexpr int INFI = 1000000007;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(N, 0);
  for (int i = 0; i < M; i++) {
    int A;
    cin >> A;
    a[A] = 1;
  }
  vector<int> dp(N);
  dp[0] = 1;
  if (a[1] != 0) {
    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];
    }
    dp[i] %= INFI;
    if (dp[i] == 0 && dp[i - 1] == 0) {
      cout << 0 << endl;
      return 0;
    }
  }
  cout << dp[N] << endl;
  return 0;
}
