#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;
const double PI = 3.14159265358979;
const ll INF = pow(10, 18);
string abc = "abcdefghijklmnopqrstuvwxyz";
string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int main() {
  ll n, m;
  cin >> n >> m;
  vector<ll> dp(n + 1, 0);
  if (m != 0) {
    vector<ll> a(m);
    for (ll i = 0; i < m; i++) {
      cin >> a[i];
    }
    dp[0] = 1;
    ll j = 0;
    if (a[0] == 1) {
      dp[1] = 0;
      j = 1;
    } else
      dp[1] = 1;
    for (ll i = 2; i < n + 1; i++) {
      if (i == a[j]) {
        j++;
        dp[i] = 0;
      } else
        dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
    }
  } else {
    dp[0] = 1;
    dp[1] = 1;
    for (ll i = 2; i < n + 1; i++) {
      dp[i] = dp[i - 1] + dp[i - 2];
    }
  }
  cout << dp[n] << endl;
}
