#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
int N, M, tmp;
bool A[10000 + 1];
int dp[10000 + 1];
int solve() {
  dp[0] = 1;
  for (int i = 1; i <= N; i++) {
    if (A[i]) continue;
    if (i == 1) {
      dp[i] += dp[i - 1];
    } else {
      dp[i] += dp[i - 2];
      dp[i] += dp[i - 1];
    }
    dp[i] %= MOD;
  }
  printf("%d\n", dp[N]);
}
int main() {
  cin >> N >> M;
  for (int i = 0; i < (M); i++) A[i] = false;
  for (int i = 0; i < (M); i++) {
    cin >> tmp;
    A[tmp] = true;
  }
  memset(dp, 0, sizeof(dp));
  solve();
}
