#include <bits/stdc++.h>
using namespace std;
template <typename T>
void remove(std::vector<T> &vector, char index) {
  vector.erase(vector.begin() + index);
}
template <class T>
T ma(std::vector<T> &v) {
  T maxi = 0;
  for (auto &i : v) maxi = max(maxi, i);
  return maxi;
}
template <class T>
T mi(std::vector<T> &v) {
  T mini = 0;
  for (auto &i : v) mini = min(mini, i);
  return mini;
}
template <class T>
T pow(T x, T y, T n = numeric_limits<T>::max()) {
  if (y == 0) return 1;
  if (y % 2 == 0) return pow((x * x) % n, y / 2);
  return (x * pow(x, y - 1)) % n;
}
int main() {
  unsigned long long n, m;
  unsigned long long ans = 1;
  cin >> n >> m;
  vector<int> A(m + 2);
  A[0] = 0;
  for (int i = 1; i <= m; i++) cin >> A[i];
  A[m + 1] = n;
  if (m >= 2) {
    for (int i = 0; i <= m - 2; i++) {
      if (A[i + 1] - (A[i] + 1) == 0) {
        cout << 0 << endl;
        return 0;
      }
    }
  }
  for (decltype(A)::iterator i = A.begin(); i != A.end() - 1; i++) {
    ans *= *(i + 1) - *i - 1;
    cout << ans << endl;
  }
  cout << ans % 1000000007 << endl;
}
