def popcount(x): x = x - ((x >> 1) & 0x55555555) x = (x & 0x33333333) + ((x >> 2) & 0x33333333) x = (x + (x >> 4)) & 0x0f0f0f0f x = x + (x >> 8) x = x + (x >> 16) return x & 0x0000007f N = int(input()) K = input() mod = 10**9+7 def solve(S,N): if N==0: s_l = S & 1 s15_l = (15-S) & 1 return abs(s15_l-s_l) + 1 res = 0 for l in range(4): s_l = S>>l & 1 s15_l = (15-S)>>l & 1 if N==1: res += abs(s15_l-s_l)+1 continue p = popcount(S) A = s_l * pow(2,3*N-3,mod) + p * pow(2,2*N-4,mod) * (pow(2,N-1,mod)-1) A %= mod q = popcount(15-S) B = s15_l * pow(2,3*N-3,mod) + q * pow(2,2*N-4,mod) * (pow(2,N-1,mod)-1) if s_l > s15_l: res += A-B+pow(2,2*N-2,mod) res %= mod else: res += B-A+pow(2,2*N-2,mod) res %= mod return res res = 0 for i in range(8): if K[i]=="o": res += solve(i,N) res %= mod print(res)