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