#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> a(M + 1);
  for (int i = 0; i < M; i++) {
    cin >> a[i];
  }
  vector<int> dp(N + 1);
  vector<int> tf(N + 1);
  for (int i = 0; i < N + 1; i++) tf[i] = 0;
  for (int i = 0; i < M; i++) tf[a[i]] = 1;
  dp[0] = 1;
  if (tf[1] == 1) {
    dp[1] = 0;
  } else {
    dp[1] = 1;
  }
  for (int i = 2; i < N + 1; i++) {
    if (tf[i] == 1) {
      dp[i] = 0;
    } else {
      dp[i] = dp[i - 1] + dp[i - 2];
    }
  }
  cout << dp[N] % 1000000007;
}
