#include <bits/stdc++.h>
using namespace std;
using ll = long long;
bitset<100000> judge;
ll MOD = 1000000007;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n, m;
  cin >> n >> m;
  vector<ll> A(m);
  bitset<10020> safe;
  safe.set();
  for (int i = 0; i < (int)(m); i++) {
    int A;
    cin >> A;
    safe.set(A, 0);
  }
  vector<ll> dp(n + 10);
  dp[1] = (safe.test(1)) ? 1 : 0;
  dp[2] = (safe.test(2)) ? dp[1] + 1 : 0;
  for (int i = 1; i <= n; i++) {
    (safe.test(i + 2)) ? dp[i + 2] = (dp[i + 1] % MOD + dp[i] % MOD) % MOD
                       : dp[i + 2] = 0;
  }
  cout << dp[n] << endl;
}
