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