#include <bits/stdc++.h>
using namespace std;
void mmin(long long &a, long long b) { a = min(a, b); }
void mmax(long long &a, long long b) { a = max(a, b); }
long long vsum(vector<long long> v) {
  return accumulate(v.begin(), v.end(), 0);
}
long long msum(vector<vector<long long> > v) {
  long long ans = 0;
  for (long long i = 0; i < v.size(); i++) {
    ans += vsum(v[i]);
  }
  return ans;
}
const long long MOD = 1000000007;
signed main() {
  long long N, M;
  cin >> N >> M;
  vector<bool> ok(N + 1, true);
  for (long long i = 0; i < M; i++) {
    long long a;
    cin >> a;
    ok[a] = false;
  }
  vector<long long> dp(N + 1, 0);
  dp[0] = 1;
  for (long long i = 0; i < N + 1; i++) {
    if (ok[i - 1]) {
      dp[i] += dp[i - 1];
      dp[i] %= MOD;
    }
    if (i > 1 && ok[i - 2]) {
      dp[i] += dp[i - 2];
      dp[i] %= MOD;
    }
  }
  cout << dp[N] << endl;
  return 0;
}
