#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m);
  for (long long i = (0); i < (m); i++) cin >> a[i];
  vector<long long> cnt(n + 1, 0);
  cnt[0] = 1;
  for (long long i = (0); i < (m); i++) cnt[a[i]] = -1;
  for (long long i = (0); i < (n + 1); i++) {
    if (cnt[i + 1] == -1) {
      cnt[i + 1] = 0;
      continue;
    }
    if (i >= 1)
      cnt[i + 1] = (cnt[i] + cnt[i - 1]) % mod;
    else
      cnt[i + 1] = cnt[i];
  }
  cout << cnt[n] << endl;
}
