#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }
int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m, false);
  for (int i = 0; i < m; i++) {
    int num;
    cin >> num;
    a[num] = true;
  }
  vector<int> dp(n + 2, 0);
  dp[n] = 1;
  for (int i = n - 1; i >= 0; i--) {
    if (a[i]) {
      dp[i] = 0;
      continue;
    }
    dp[i] = (dp[i + 1] + dp[i + 2]) % 1000000007;
    cout << dp[i] << endl;
  }
  cout << dp[0] << endl;
  return 0;
}
