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