#include <bits/stdc++.h>
using namespace std;
static const long long MOD = 1e9 + 7;
static const long long INF = 1e18;
static const long long MAX_N = 10000;
static const long long MAX_M = 10000;
static const int White = 0;
static const int Gray = 1;
static const int Black = 2;
void pvector(vector<int> A) {
  cout << "[vector]";
  for (int i = 0; i < A.size(); i++) {
    cout << A[i] << " ";
  }
  cout << endl;
}
int main() {
  long long N, M;
  cin >> N >> M;
  int A[MAX_N + 1] = {0};
  for (int i = 0; i < M; ++i) {
    int a;
    cin >> a;
    A[a]++;
  }
  long long dp[MAX_N + 1] = {0};
  dp[0] = 1;
  dp[1] = 1;
  for (int i = 2; i <= N; i++) {
    if (A[i] == 0) {
      if (A[i - 1] == 0 && A[i - 2] == 0)
        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
      else if (A[i - 1] == 0 && A[i - 2] != 0)
        dp[i] = dp[i - 1] % MOD;
      else if (A[i - 1] != 0 && A[i - 2] == 0)
        dp[i] = dp[i - 2] % MOD;
      else
        dp[i] = 0;
    }
  }
  cout << (dp[N]) << endl;
}
