#include <bits/stdc++.h>
using namespace std;
int main() {
  long long mod = 1000000007;
  int n;
  cin >> n;
  int m;
  cin >> m;
  unordered_set<int> broken;
  for (int i = 0; i < (m); ++i) {
    int a;
    cin >> a;
    broken.insert(a);
  };
  vector<long long> cnt(n + 1);
  cnt[0] = 1;
  for (int i = 1; i <= n; i++) {
    if (broken.find(i) != broken.end()) {
      cnt[i] = 0;
    } else {
      cnt[i] = (cnt[i - 1] + cnt[i - 2]) % mod;
    }
  }
  cout << cnt[n] << endl;
  return 0;
}
