#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M);
  for (int i = 0; i < M; i++) {
    cin >> a[i];
    a[i]--;
  }
  vector<ll> dp(N);
  for (int i = 0; i < N; i++) {
    bool ok = true;
    for (int j = 0; j < M; j++) {
      if (a[j] == i) {
        ok = false;
        break;
      }
    }
    if (!ok) {
      dp[i] = 0;
      continue;
    }
    if (i == 0) {
      dp[i] = 1;
    } else if (i == 1) {
      dp[i] = dp[i - 1] + 1;
    } else
      dp[i] = dp[i - 1] + dp[i - 2];
  }
  cout << dp[N - 1] % 1000000007 << endl;
  return 0;
}
