#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  vector<bool> v(n + 1);
  for (int i = 0; i < m; ++i) {
    int e;
    cin >> e;
    v[e] = true;
  }
  const long long MOD = 1e9 + 7;
  vector<long long> dp(n + 1, -1);
  function<long long(long long)> DP = [&](long long i) -> long long {
    if (i == n) return 1;
    if (v[i]) return 0;
    if (dp[i] != -1) return dp[i];
    return dp[i] = ((DP(i + 1) % MOD) + (DP(i + 2) % MOD)) % MOD;
  };
  cout << DP(0);
}
