Please tell me what is wrong in my code:

```
try:
def mod_power_func(x,n,m):
if n==0:
return 1
elif n%2==0:
return(mod_power_func((x*x)%m,int(n/2),m))
else:
return(x*mod_power_func((x*x)%m,int(n-1)/2,m))
def main():
t=int(input())
for _ in range(t):
k=int(input())
falg=1
s=[int(x) for x in input().split()]
sum=0
for i in range(1,len(s)):
if s[i-1]&s[i] != s[i-1]:
falg=0
break
else:
sum+=(bin(s[i-1]&s[i]).count("1"))
if falg!=0:
print(mod_power_func(2,sum,1000000007))
else:
print(0)
if __name__ == "__main__":
main()
except:
pass
```