Help me in solving XOREQUAL problem

My issue

My code

#include <iostream>
using namespace std;

#define mod 1000000007
long long int power(int a,int b){
    long long int ans=1;
    for(int j=0;j<32;++j){
        if((b>>j)&1){
            ans=((ans%mod)*(a%mod))%mod;
        }
        a*=a;
    }
    return ans;
}

int main() {
	// your code goes here
	int t;
	cin>>t;
	while(t--){
	    int n;
	    cin>>n;

	    cout<<power(2,n-1)%mod<<endl;
	}
	return 0;
}

Problem Link: XOREQUAL Problem - CodeChef

@tarangrangani3
your code is not working for higher values of n its printing 0