#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, M;
  bool a[10000] = {false};
  cin >> N >> M;
  int tmp = 0, old = -2;
  for (int i = 0; i < M; i++) {
    cin >> tmp;
    a[tmp] = true;
  }
  long long dp[N + 1];
  dp[0] = 1;
  if (!a[1])
    dp[1] = 1;
  else
    dp[1] = 0;
  for (int i = 2; i <= N; i++) {
    if (a[i])
      dp[i] = 0;
    else
      dp[i] = dp[i - 1] + dp[i - 2];
    dp[i] = dp[i];
  }
  cout << dp[N] % int(1e+9 + 7) << endl;
  return 0;
}
