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