#include #include #include using namespace atcoder; using mint = modint1000000007; using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 10000000000000000 int main(){ int N,M; cin>>N>>M; for(int i=1;i<=M;i++){ if(i==1){ cout<y)swap(x,y); x += 2; if(x>y)swap(x,y); x--; } cout<1){ long long mid = (ok+ng)/2; if(mid*b+((long long)i-2-mid)*a > (N-3))ng = mid; else ok = mid; } mint ans = mint(a).pow(i-2-ok); ans *= mint(b).pow(ok); ans *= 2; cout<