#include <bits/stdc++.h>
using namespace std;
int main() {
  long long mod = 1000000007;
  int n, m;
  cin >> n >> m;
  vector<int> out(m);
  for (int i = 0; i < (m); ++i) {
    cin >> out.at(i);
  }
  vector<long long> stairs(n, 1);
  for (int i = 0; i < (m); ++i) {
    stairs[out[i] - 1] = 0;
  }
  if (stairs[0] == 1) {
    stairs[1] = 2;
  }
  for (int i = 0; i < (n - 2); ++i) {
    if (stairs[i + 2] != (long long)0) {
      stairs[i + 2] = (stairs[i + 1] + stairs[i]) % mod;
    }
  }
  for (int i = 0; i < (n); ++i) {
    cout << i << "    " << stairs[i] << endl;
  }
  cout << stairs[n - 1] % 1000000007 << endl;
}
