#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
int main() {
  long long int n, k, l;
  cin >> n >> k;
  long long int i;
  map<long long int, long long int> mp;
  vector<long long int> d(n + 1);
  d[0] = 1;
  d[1] = 1;
  for (i = 0; i < k; ++i) {
    cin >> l;
    mp[l] = 1;
  }
  for (i = 1; i < n + 1; ++i) {
    d[i] = (d[i - 1] + d[i - 2]) % M;
    if (mp.find(i) != mp.end()) {
      d[i] = 0;
    }
  }
  cout << d[n] << endl;
}
