#include <bits/stdc++.h>
using namespace std;
int main() {
  long long N, M, i, x;
  cin >> N >> M;
  bool D[N];
  long long dp[N];
  for (int i = 1; i <= (int)(N); i++) {
    dp[i] = 1000000;
    D[i] = true;
  }
  dp[-1] = 0, dp[0] = 1;
  for (int i = 1; i <= (int)(M); i++) {
    cin >> x;
    D[x] = false;
  }
  for (int i = 1; i <= N; i++) {
    if (D[i]) {
      dp[i] = (dp[i - 2] + dp[i - 1]) % 1000000007;
    } else
      dp[i] = 0;
  }
  cout << dp[N] << endl;
}
