#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using ld = long double;
using pii = pair<int, int>;
int main() {
  int n, m;
  cin >> n >> m;
  ll a[100005];
  for (ll i = 0; i < (ll)(m); ++i) cin >> a[i];
  pair<ll, ll> dp[100050];
  for (ll i = 0; i < (ll)(100049); ++i) dp[i].first = 0;
  dp[1].first = 0;
  dp[2].first = 1;
  for (ll i = 0; i < (ll)(m); ++i) dp[a[i]].second = 1;
  if (a[1] == 1) dp[1].first = 0, dp[2].first = 1;
  if (a[1] == 2 || a[2] == 1) dp[2].first = 0;
  for (ll i = 3; i < (ll)(100040); ++i) {
    if (dp[i].second)
      dp[i].first = 0;
    else
      dp[i].first = (dp[i - 1].first + dp[i - 2].first) % (1000000007);
  }
  cout << dp[n].first;
}
