#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long n, m;
  cin >> n >> m;
  long long a[100050];
  vector<bool> ok(100050, false);
  for (long long i = 1; i <= m; i++) {
    cin >> a[i];
    ok[a[i]] = true;
  }
  long long dp[100050];
  dp[0] = 1;
  const long long MOD = 1e9 + 7;
  for (long long i = 1; i <= n; i++) {
    if (ok[i]) continue;
    if (i >= 2)
      dp[i] = (dp[i - 1] + dp[i - 2]) % MOD;
    else
      dp[i] = dp[i - 1] % MOD;
  }
  cout << dp[n] << endl;
  return 0;
}
