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