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