#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  int A_Input;
  bool A[100001];
  long Count[100001];
  int Ans = -1;
  cin >> N;
  cin >> M;
  for (int i = 0; i <= N; i++) {
    A[i] = false;
  }
  for (int i = 1; i <= M; i++) {
    cin >> A_Input;
    A[A_Input] = true;
  }
  if (N == 1) {
    cout << 1 << endl;
  } else {
    Count[0] = 1;
    if (A[1]) {
      Count[1] = 0;
    } else {
      Count[1] = 1;
    }
    for (int i = 2; i <= N; i++) {
      if (A[i - 2] && A[i - 1]) {
        Ans = 0;
        break;
      } else if (!A[i]) {
        Count[i] = (Count[i - 1] + Count[i - 2]) % 1000000007;
      } else {
        Count[i] = 0;
      }
    }
    for (int i = 0; i <= N; i++) {
      cout << i << "番目" << Count[i] << endl;
    }
    if (Ans != 0) {
      Ans = Count[N];
    }
    cout << Ans << endl;
  }
}
