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