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