#include <bits/stdc++.h>
using namespace std;
const int b = 1e9 + 7;
int main() {
  long long N, M;
  cin >> N >> M;
  vector<long long> dp(N + 10, 0);
  vector<bool> flag(N + 10, true);
  for (long long i = 0; i < M; i++) {
    long long a;
    cin >> a;
    flag[a] = false;
  }
  flag[0] = 1;
  if (flag[1] == true) {
    dp[1] = 1;
  }
  for (long long i = 2; i < N + 10; i++) {
    if (flag[i] == true) {
      dp[i] = (dp[i - 1] + dp[i - 2]) % b;
    }
  }
  cout << dp[N] << endl;
  return 0;
}
