#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m, mod;
  mod = pow(10, 9) + 7;
  cin >> n >> m;
  vector<long long> data(m), data1(n + 4);
  data1[0] = 1;
  for (long long i = 0; i < m; i++) cin >> data[i];
  for (long long i = 0; i < n; i++) {
    if (find(data.begin(), data.end(), i + 1) == data.end())
      data1[i + 1] = (data1[i + 1] + data1[i]) % mod;
    if (find(data.begin(), data.end(), i + 2) == data.end())
      data1[i + 2] = (data1[i + 2] + data1[i]) % mod;
  }
  cout << data1[n] << endl;
  return 0;
}
