#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
int main() {
  int N, M, s, num = 0;
  long long int count = 1;
  cin >> N >> M;
  vector<int> oks(N + 1, true);
  vector<long long int> dp(N + 1, 0);
  for (int i = 0; i < M; i++) {
    cin >> s;
    oks[s] = false;
  }
  dp[0] = 1;
  for (int i = 1; i < N + 1; i++) {
    if (oks[i]) {
      if (i == 1) {
        dp[i] = 1;
      } else {
        dp[i] = dp[i - 1] + dp[i - 2];
      }
    } else {
      dp[i] = 0;
    }
  }
  cout << dp[N] % mod << endl;
  return 0;
}
