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