#include <bits/stdc++.h>
using namespace std;
const long MOD = 1e9 + 7;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  int a_i;
  for (int i = 0; i < M; i++) {
    cin >> a_i;
    a.push_back(a_i);
  }
  long dp[N + 1];
  bool is_count = true;
  for (int n = 0; n <= N; n++) {
    is_count = true;
    for (const auto& a_i : a) {
      if (n == a_i && n != 0) {
        dp[n] = 0;
        is_count = false;
        break;
      }
    }
    if (is_count) {
      if (n == 0 || n == 1)
        dp[n] = 1;
      else
        dp[n] = dp[n - 1] + dp[n - 2];
      if (dp[n] == 0) {
        dp[N] = 0;
        break;
      }
    }
  }
  cout << dp[N] % MOD << endl;
  return 0;
}
