#include using namespace std; typedef long long ll; typedef pair P; #define REP(i,n) for(ll i=0;i> N >> M; if(g(N,M)==1) cout << 1 << endl; else cout << 0 << endl; return 0; }