#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, m, i, j, ans;
  vector<long long int> a, s;
  cin >> n >> m;
  (a).resize(m);
  (s).resize(pow(10, 5) + 1);
  for (i = 0; i < m; i++) {
    cin >> a[i];
  }
  s[0] = 1;
  s[1] = 1;
  s[2] = 2;
  for (i = 3; i < pow(10, 5) + 1; i++) {
    s[i] = (s[i - 1] + s[i - 2]) % 1000000007;
  }
  j = 0;
  ans = 1;
  for (i = 0; i < m; i++) {
    if (a[i] == j) {
      cout << 0;
      return 0;
    }
    ans *= s[a[i] - j - 1];
    cout << ans << endl;
    ans %= 1000000007;
    j = a[i] + 1;
  }
  ans *= s[n - j];
  ans %= 1000000007;
  cout << ans;
  return 0;
}
