#pragma GCC optimize("Ofast")
#pragma GCC target("avx")
#include <bits/stdc++.h>
const int mod = (int)1e9+7;
int add(int a, int b) { return (a += b) >= mod ? a -= mod : a; }
int mul(int a, int b) { return int(1LL * a * b % mod); }
int pow(int a, int n) {
if (n == 0) return 1;
if (a <= 1) return a;
int r(1);
while (n) {
if (n % 2) r = mul(a,r);
a = mul(a,a);
n >>= 1;
}
return r;
}
int main() {
int s = 0;
std::cout << "{" << s;
for (int n = 1; n <= (int)1e7; n++) {
int term = pow(n, mod-2);
term = mul(term,term);
s = add(s, term);
if (n % (int)1e6 == 0) {
std::cout << ',' << s;
}
}
std::cout << "}";
return 0;
}
I3ByYWdtYSBHQ0Mgb3B0aW1pemUoIk9mYXN0IikKI3ByYWdtYSBHQ0MgdGFyZ2V0KCJhdngiKQojaW5jbHVkZSA8Yml0cy9zdGRjKysuaD4KY29uc3QgaW50IG1vZCA9IChpbnQpMWU5Kzc7CmludCBhZGQoaW50IGEsIGludCBiKSB7IHJldHVybiAoYSArPSBiKSA+PSBtb2QgPyBhIC09IG1vZCA6IGE7IH0KaW50IG11bChpbnQgYSwgaW50IGIpIHsgcmV0dXJuIGludCgxTEwgKiBhICogYiAlIG1vZCk7IH0KaW50IHBvdyhpbnQgYSwgaW50IG4pIHsKICAgIGlmIChuID09IDApIHJldHVybiAxOwogICAgaWYgKGEgPD0gMSkgcmV0dXJuIGE7CiAgICBpbnQgcigxKTsKICAgIHdoaWxlIChuKSB7CiAgICAgICAgaWYgKG4gJSAyKSByID0gbXVsKGEscik7CiAgICAgICAgYSA9IG11bChhLGEpOwogICAgICAgIG4gPj49IDE7CiAgICB9CiAgICByZXR1cm4gcjsKfQppbnQgbWFpbigpIHsKICAgIGludCBzID0gMDsKICAgIHN0ZDo6Y291dCA8PCAieyIgPDwgczsKICAgIGZvciAoaW50IG4gPSAxOyBuIDw9IChpbnQpMWU3OyBuKyspIHsKICAgICAgICBpbnQgdGVybSA9IHBvdyhuLCBtb2QtMik7CiAgICAgICAgdGVybSA9IG11bCh0ZXJtLHRlcm0pOwogICAgICAgIHMgPSBhZGQocywgdGVybSk7CiAgICAgICAgaWYgKG4gJSAoaW50KTFlNiA9PSAwKSB7CiAgICAgICAgICAgIHN0ZDo6Y291dCA8PCAnLCcgPDwgczsKICAgICAgICB9CiAgICB9CiAgICBzdGQ6OmNvdXQgPDwgIn0iOwogICAgcmV0dXJuIDA7Cn0=
{0,691281592,513558697,301428948,825737147,753460309,655962325,947635491,307001071,900886440,139907876}