#include <bits/stdc++.h>
using ll = long long;
using namespace std;
int main() {
  ll n, m;
  cin >> n >> m;
  set<ll> a;
  for (int i = 0; i < (m); i++) {
    ll c;
    cin >> c;
    a.insert(c);
  }
  vector<ll> dp(n + 1);
  dp[0] = 1;
  if (a.count(1)) {
    dp[1] = 0;
  } else
    dp[1] = 1;
  for (int i = 0; i < (n - 1); i++) {
    if (!(a.count(i + 2))) {
      dp[i + 2] = dp[i + 1] + dp[i];
    } else
      dp[i + 2] = 0;
  }
  dp[n] %= 1000000007;
  cout << dp[n] << endl;
}
