#include <bits/stdc++.h>
using namespace std;
long memo[100000];
long fib(long n) {
  if (n == 0) {
    return 0;
  } else if (n == 1) {
    return 1;
  } else if (memo[n] != 0) {
    return memo[n];
  }
  return memo[n] = fib(n - 1) + fib(n - 2);
}
int main() {
  int n, m;
  long ans;
  cin >> n >> m;
  int a[m];
  a[0] = -1;
  ans = 1;
  for (int i = 1; i < m + 1; i++) cin >> a[i];
  for (int i = 1; i < m + 1; i++) {
    ans = ans * (fib(a[i] - a[i - 1] - 1) % 1000000007) % 1000000007;
    cout << ans << endl;
  }
  cout << ans;
  return 0;
}
