i am trying to debug this code since two days still i am not able to understand what is wrong with it.can somebody help

```
#include <iostream>
using namespace std;
long long int power(long long x, long long int y,long long int p)
{
long long int res = 1;
x = x % p;
if(y==1)
return x;
if(y==0)
return 1;
if (x == 0) return 0;
while (y > 0)
{
if (y & 1)
res = ((res%p)*(x%p)) % p;
y = y>>1; // y = y/2
x = ((x%p)*(x%p)) % p;
}
return res;
}
int main() {
// your code goes here
long long int t;
cin>>t;
while(t--)
{
long long int N,M;
cin>>N>>M;
cout<<power((2,N,1000000007)-1,M,1000000007)<<endl;;
}
return 0;
}
```