#include <bits/stdc++.h>
using namespace std;
constexpr int dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
constexpr int dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template <class T>
bool chmin(T &a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <class T>
bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int main() {
  ofstream fout("out.txt");
  long long n = 1e9, m = 1000000;
  ll t = 1;
  for (int i = 0; i <= m; ++i) {
    t *= (i + 1);
    t %= 1000000007ll;
  }
  cout << t << endl;
  ll ret = 1;
  fout << "{";
  for (long long i = 0; i < n; ++i) {
    ret *= (i + 1);
    ret %= 1000000007ll;
    if (i % m == 0) fout << ret << ",";
  }
  fout << "}";
  cout << "done" << endl;
}
