#include using namespace std; #define modulo 1000000007 #define mod(mod_x) ((((long long)mod_x+modulo))%modulo) #define Inf 1000000000 //aのb乗 int beki(int a,int b,int M = modulo){ int x = 1; while(b!=0){ if(b&1){ x=((long long)x*a)%M; } a=((long long)a*a)%M; b>>=1; } return x; } //aの逆元 int gyakugen(int a){ return beki(a,modulo-2); } int main(){ int N; cin>>N; int p; cin>>p; vector a(N); a[0] = 0; a[1] = 1; for(int i=2;i