#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  vector<long long> a(m);
  for (int i = 0; i < m; i++) {
    cin >> a.at(i);
  }
  vector<long long> dp(n + 1);
  long long co = 0;
  for (int i = 0; i <= n; i++) {
    if (i == 0) {
      dp.at(i) = 1;
    } else if (i == 1) {
      dp.at(i) = 1;
    } else if (i > 1) {
      dp.at(i) =
          (dp.at(i - 1) % 1000000007 + dp.at(i - 2) % 1000000007) % 1000000007;
    }
    if (m == 0) continue;
    if (a.at(co) == i) {
      dp.at(i) = 0;
      co++;
      if (co >= m) co = 0;
    }
    cout << dp.at(i) << endl;
  }
  cout << dp.at(n) % 1000000007 << endl;
}
