#include <bits/stdc++.h>
using namespace std;
const long long INF = 1LL << 60;
const long long MOD = 1000000007;
int GCD(int a, int b) { return b ? GCD(b, a % b) : a; }
int dp[100010];
int main(void) {
  int N, M;
  vector<bool> no(M);
  cin >> N >> M;
  for (int i = 0; i < M; i++) {
    int a;
    cin >> a;
    no[a] = true;
  }
  dp[0] = 1;
  for (int i = 1; i <= N; i++) {
    if (no[i]) continue;
    dp[i] += dp[i - 1];
    dp[i] %= MOD;
    if (i >= 2) {
      dp[i] += dp[i - 2];
      dp[i] %= MOD;
    }
  }
  cout << dp[N] << endl;
}
