#include using namespace std; typedef unsigned long long int ull; typedef long long int ll; typedef pair pll; typedef long double D; //typedef complex P; #define F first #define S second const ll MOD=1000000007; //const ll MOD=998244353; templateistream & operator >> (istream &i,pair &A){i>>A.F>>A.S; return i;} templateistream & operator >> (istream &i,vector &A){for(auto &I:A){i>>I;} return i;} templateostream & operator << (ostream &o,const pair &A){o<ostream & operator << (ostream &o,const vector &A){int i=A.size(); for(auto &I:A){o<0){ if(x&1){(ret*=a)%=p;} (a*=a)%=p; x>>=1; } return ret; } int main(){ cin.tie(0); ios::sync_with_stdio(false); ll P,N; cin>>P>>N; if(P==2){cout<<0<