#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1e9 + 7;
long long N, M, stairs[100010], a;
long long dp[10010];
int main() {
  cin >> N >> M;
  for (int i = 0; i < M; ++i) {
    cin >> a;
    stairs[a] = 1;
  }
  dp[0] = 1;
  for (long long i = 0; i < N; ++i) {
    for (long long j = i + 1; j <= min(N, i + 2); ++j) {
      if (stairs[j] == 0) {
        dp[j] += dp[i];
        dp[j] %= MOD;
      }
    }
  }
  cout << dp[N] << endl;
  return 0;
}
