#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> S(N + 5, 0);
  vector<bool> B(N + 5, true);
  S[0] = 1;
  for (int i = 0; i < M; i++) {
    int t;
    cin >> t;
    B[t] = false;
  }
  for (int i = 0; i < N; i++) {
    if (B[i + 1]) {
      S[i + 1] = (S[i + 1] + S[i]) % MOD;
    }
    if (B[i + 1]) {
      S[i + 2] = (S[i + 2] + S[i]) % MOD;
    }
  }
  cout << S[N] << endl;
}
