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