#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define REP(i,n) for(int (i)=0; (i)<(n) ;++(i)) #define REPN(i,a,n) FOR((i),(a),(a)+(n)) #define FOR(i,a,b) for(int (i)=(a); (i)<(b) ;++(i)) #define PB push_back #define MP make_pair #define SE second #define FI first #define DBG(a) cerr<<(a)< PLL; typedef vector VLL; typedef pairPI; typedef vector VI; const LL LINF=334ll<<53; const int INF=15<<26; const LL MOD=1E9+7; int main(){ cin.tie(0); ios::sync_with_stdio(false); int n,k; cin >> n >> k; vector a; LL ans=1ll; a.push_back(0ll); a.push_back((1ll<> tmp; a.push_back(tmp); } sort(ALL(a)); a.erase(unique(ALL(a)),a.end()); FOR(i,1,a.size()){ int c=__builtin_popcount(a[i-1]); int d=__builtin_popcount(a[i]); REP(j,n){ if(((a[i-1]>>j)&1ll)>((a[i]>>j)&1ll)){ cout << 0 << endl; return 0; } } FOR(j,1,d-c+1){ ans=(ans*j)%MOD; } } cout << ans <