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