#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int N, M;
  cin >> N >> M;
  vector<long long int> A(M);
  vector<long long int> B(N + 1);
  for (long long int i = 0; i < M; i++) cin >> A[i];
  B[0] = 1;
  long long int a = 0;
  for (long long int i = 1; i < N + 1; i++) {
    if (i == A[a]) {
      B[i] = 0;
      a++;
    } else {
      if (i == 1)
        B[i] = 1;
      else
        B[i] = (B[i - 1] % 1000000007 + B[i - 2] % 1000000007) % 1000000007;
    }
  }
  cout << B[N];
}
