#include <bits/stdc++.h>
using namespace std;
const int NMAX = 100050;
const int MOD = 1000000007;
int main() {
  int N, M;
  cin >> N >> M;
  vector<bool> broken(N + 2, false);
  for (int i = 0; i < (M); ++i) {
    int a;
    cin >> a;
    broken[a] = true;
  }
  int dp[NMAX];
  dp[0] = 1;
  for (int i = 1; i < N + 1; i++) {
    if (broken[i]) {
      dp[i] == 0;
      continue;
    }
    if (i == 1) {
      dp[i] = dp[i - 1];
      dp[i] %= MOD;
    } else {
      dp[i] = dp[i - 1] + dp[i - 2];
      dp[i] %= MOD;
    }
  }
  cout << dp[N] << endl;
  return 0;
}
