#include <bits/stdc++.h>
using namespace std;
bool bad[100005];
long long cnt[100005];
int main() {
  long long N, M;
  cin >> N >> M;
  for (long long i = 0; i < M; i++) {
    long long a;
    cin >> a;
    bad[a] = true;
  }
  cnt[0] = 1;
  for (long long i = 0; i <= N; i++) {
    if (!bad[i + 1]) cnt[i + 1] += cnt[i];
    if (!bad[i + 2]) cnt[i + 2] += cnt[i];
  }
  cout << cnt[N] % 1000000007 << endl;
}
