#include <bits/stdc++.h>
using namespace std;
using namespace std;
int main(void) {
  int N, M;
  cin >> N >> M;
  vector<int> a(M), dp(N + 1, 0);
  for (auto& i : a) cin >> i;
  dp[N] = 1;
  if (a.back() != N - 1) dp[N - 1] = 1;
  for (int n = N - 2; n >= 0; n--) {
    if (!binary_search(a.begin(), a.end(), n)) {
      dp[n] = (dp[n + 1] + dp[n + 2]) % 1000000007;
    }
  }
  cout << dp[0] << endl;
  return 0;
}
