#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> a(m);
  for (ll i = 0; i < m; i++) {
    cin >> a[i];
  }
  vector<ll> dp(n + 1, 0);
  dp[0] = 1;
  ll j = 0;
  for (ll i = 1; i < n + 1; i++) {
    if (i == a[j]) {
      j++;
      dp[i] = 0;
    } else
      dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
  }
  cout << dp[n] << endl;
}
