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