t = int(input()) while t != 0: q = int(input()) ways = 1 if int(q) % 2 == 0: ways+=1 temp = q while temp > 2: temp-=2 ways+= (2 ** temp) print(ways % 1000000007) t-=1