#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
int main() {
  int N, M;
  cin >> N >> M;
  bool torf1 = false, torf2 = false;
  vector<int> A(M);
  vector<int> dp(N);
  vector<bool> B(N, false);
  for (int i = 0; i < M; i++) {
    cin >> A.at(i);
    B.at(A.at(i) - 1) = true;
  }
  dp.at(0) = 0;
  if (B.at(0) != true && B.at(1) != true)
    dp.at(1) = 2;
  else if (B.at(0) == true && B.at(1) != true)
    dp.at(1) = 1;
  for (int i = 2; i < N; i++) {
    if (B.at(i) != true) {
      if (B.at(i - 1) == true && B.at(i - 2) != true)
        dp.at(i) = dp.at(i - 2) % 1000000007;
      else if (B.at(i - 2) == true && B.at(i - 1) != true)
        dp.at(i) = dp.at(i - 1) % 1000000007;
      else if (B.at(i - 2) == true && B.at(i - 1) == true) {
        dp.at(N - 1) = 0;
        break;
      } else
        dp.at(i) = (dp.at(i - 1) + dp.at(i - 2)) % 1000000007;
    }
  }
  cout << dp.at(N - 1) << endl;
}
