#include<iostream>
#include<vector>
using namespace std;
int main () {
  int MOD = 1e9 + 7;
  int N, M;
  cin >> N >> M;
  vector<int>ans(N, 0);
  verctor<bool>sta(N, true);
  for (int i = 0; i < M; i ++) {
    int a;
    cin >> a;
    sta[a - 1] = false;
  }
  if (sta[0]) ans[0] = 1;
  if (sta[1]) ans[1] = ans[0] + 1;
  for (int i = 2; i < N; i ++) {
    if (sta[i]) {
      ans[i] = ans[i - 1] + ans[i - 2];
      ans %= MOD;
    }
  }
  cout << ans[N - 1] << endl;
}
  