#include <bits/stdc++.h>
using namespace std;
signed main() {
  long N, M;
  cin >> N >> M;
  vector<long> No(M);
  for (long i = 0; i < M; i++) {
    cin >> No.at(i);
  }
  long dp[100010];
  vector<bool> vec(100010, true);
  for (long i = 0; i < M; i++) {
    vec.at(No.at(i)) = false;
  }
  dp[0] = 1;
  if (vec.at(1) == true) {
    dp[1] = 1;
  }
  for (long i = 2; i <= N; i++) {
    if (vec.at(i) == true) {
      dp[i] = (dp[i - 2] + dp[i - 1]) % 1000000007;
    }
  }
  cout << dp[N] << endl;
}
