#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  int a[M];
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  long dp[N];
  for (int i = 0; i < N; i++) dp[i] = -1000;
  dp[0] = 1;
  dp[1] = 2;
  if (a[0] == 1) dp[1] = 1;
  int noa = 0;
  for (int i = 0; i < N; i++) {
    if (a[noa] == i) {
      dp[i - 1] = 0;
      noa++;
    }
    if (noa > M) break;
  }
  for (int i = 2; i < N; i++) {
    if (dp[i] == 0) continue;
    if (dp[i - 1] == 0 && dp[i - 2] == 0) {
      cout << 0;
      return 0;
    }
    dp[i] = dp[i - 1] + dp[i - 2];
  }
  if (dp[N - 1] == 0) dp[N - 1] = dp[N - 2];
  cout << dp[N - 1] % 1000000007;
  return 0;
}
