#include <bits/stdc++.h>
using namespace std;
void io_init() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
};
const int MOD = 1000000007;
int main(int argc, char **argv) {
  io_init();
  int N, M;
  cin >> N >> M;
  vector<bool> broke(N + 1, false);
  for (auto i = (0); i != (M); i++) {
    int s;
    cin >> s;
    broke[s] = true;
  }
  vector<int> dp(N, 0);
  for (auto i = (N); i != (-1); i--) {
    if (i == N) {
      dp[i] = 1;
      continue;
    }
    if (broke[i]) continue;
    dp[i] = dp[i + 1];
    if (i + 2 <= N) dp[i] = (dp[i] + dp[i + 2]) % MOD;
  }
  cout << dp[0] << '\n';
  return 0;
};
