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