#include <bits/stdc++.h>
using namespace std;
int main(void) {
  int N, M;
  cin >> N >> M;
  int k = M;
  long long int broken[10002], dp[10002] = {0};
  for (int i = 0; i < M; i++) cin >> broken[i];
  dp[N] = 1;
  for (int i = N - 1; 0 <= i; i--) {
    if (0 <= k - 1 && broken[k - 1] == i) {
      dp[i] = 0;
      k--;
    } else {
      dp[i] = (dp[i + 1] + dp[i + 2]) % 1000000007;
    }
  }
  cout << dp[0] << endl;
}
