#include int ri() { int n; scanf("%d", &n); return n; } template struct ModInt{ int x; ModInt () : x(0) {} ModInt (int64_t x) : x(x >= 0 ? x % mod : (mod - -x % mod) % mod) {} ModInt &operator += (const ModInt &p){ if ((x += p.x) >= mod) x -= mod; return *this; } ModInt &operator -= (const ModInt &p) { if ((x += mod - p.x) >= mod) x -= mod; return *this; } ModInt &operator *= (const ModInt &p) { x = (int64_t) x * p.x % mod; return *this; } ModInt &operator /= (const ModInt &p) { *this *= p.inverse(); return *this; } ModInt &operator ^= (int64_t p) { ModInt res = 1; for (; p; p >>= 1) { if (p & 1) res *= *this; *this *= *this; } return *this = res; } ModInt operator - () const { return ModInt(-x); } ModInt operator + (const ModInt &p) const { return ModInt(*this) += p; } ModInt operator - (const ModInt &p) const { return ModInt(*this) -= p; } ModInt operator * (const ModInt &p) const { return ModInt(*this) *= p; } ModInt operator / (const ModInt &p) const { return ModInt(*this) /= p; } ModInt operator ^ (int64_t p) const { return ModInt(*this) ^= p; } bool operator == (const ModInt &p) const { return x == p.x; } bool operator != (const ModInt &p) const { return x != p.x; } explicit operator int() const { return x; } ModInt &operator = (const int p) { x = p; return *this;} ModInt inverse() const { int a = x, b = mod, u = 1, v = 0, t; while (b > 0) { t = a / b; a -= t * b; std::swap(a, b); u -= t * v; std::swap(u, v); } return ModInt(u); } friend std::ostream & operator << (std::ostream &stream, const ModInt &p) { return stream << p.x; } friend std::istream & operator >> (std::istream &stream, ModInt &a) { int64_t x; stream >> x; a = ModInt(x); return stream; } }; typedef ModInt<1000000007> mint; template struct MComb { using mint = ModInt; std::vector fact; std::vector inv; MComb (int n) { // O(n + log(mod)) fact = std::vector(n + 1, 1); for (int i = 1; i <= n; i++) fact[i] = fact[i - 1] * mint(i); inv.resize(n + 1); inv[n] = fact[n] ^ (mod - 2); for (int i = n; i--; ) inv[i] = inv[i + 1] * mint(i + 1); } mint ncr(int n, int r) { return fact[n] * inv[r] * inv[n - r]; } mint npr(int n, int r) { return fact[n] * inv[n - r]; } mint nhr(int n, int r) { assert(n + r - 1 < (int) fact.size()); return ncr(n + r - 1, r); } }; int main() { int64_t n; std::cin >> n; std::string s; std::cin >> s; mint p2 = mint(2) ^ n; mint p22 = mint(2) ^ (2 * n); mint res = 0; for (int i = 0; i < 8; i++) { if (s[i] != 'o') continue; for (int j = 0; j < 4; j++) { mint one = 0; for (int k = 0; k < 4; k++) { if ((i >> j & 1) != (i >> k & 1)) one -= 1; else one += 1; } one /= 4; res += ((p2 / 2 - 1) * one + (p2 / 2)) * (p22 / 4); } /* for (int j = 0; j < 1 << n; j++) { for (int k = 0; k < 1 << n; k++) { int cur_res = 0; for (int l = 0; l < n; l++) { int cur = (j >> l & 1) << 1 | (k >> l & 1); cur_res += ((i >> cur & 1) ? 1 : -1) * (1 << l); } res += std::abs(cur_res) + 1; } }*/ res += p22; } std::cout << res << std::endl; return 0; }