#include <bits/stdc++.h>
using namespace std;
signed main() {
  long long n, m;
  bool disable[100006] = {};
  long long cnt[100006] = {};
  cin >> n >> m;
  for (long long i = 0; i < m; i++) {
    long long a;
    cin >> a;
    disable[a] = true;
  }
  cnt[1] = !disable[1];
  cnt[2] = !disable[2] + cnt[1];
  for (long long i = 3; i < n + 1; i++) {
    if (disable[i] == false) {
      cnt[i] = cnt[i - 1] + cnt[i - 2];
      cnt[i] %= 1000000007;
    }
  }
  cout << cnt[n] << endl;
}
