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