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