The presidential election is coming in Bearland next year! Everybody is so excited about this!

So far, there are three candidates, Alice, Bob, and Charlie. 

There are n citizens in Bearland. The election result will determine the life of all citizens of Bearland for many years. Because of this great responsibility, each of n citizens will choose one of six orders of preference between Alice, Bob and Charlie uniformly at random, independently from other voters.

The government of Bearland has devised a function to help determine the outcome of the election given the voters preferences. More specifically, the function is <image> (takes n boolean numbers and returns a boolean number). The function also obeys the following property: f(1 - x1, 1 - x2, ..., 1 - xn) = 1 - f(x1, x2, ..., xn).

Three rounds will be run between each pair of candidates: Alice and Bob, Bob and Charlie, Charlie and Alice. In each round, xi will be equal to 1, if i-th citizen prefers the first candidate to second in this round, and 0 otherwise. After this, y = f(x1, x2, ..., xn) will be calculated. If y = 1, the first candidate will be declared as winner in this round. If y = 0, the second will be the winner, respectively.

Define the probability that there is a candidate who won two rounds as p. p·6n is always an integer. Print the value of this integer modulo 109 + 7 = 1 000 000 007.

Input

The first line contains one integer n (1 ≤ n ≤ 20).

The next line contains a string of length 2n of zeros and ones, representing function f. Let bk(x) the k-th bit in binary representation of x, i-th (0-based) digit of this string shows the return value of f(b1(i), b2(i), ..., bn(i)).

It is guaranteed that f(1 - x1, 1 - x2, ..., 1 - xn) = 1 - f(x1, x2, ..., xn) for any values of x1, x2, ldots, xn.

Output

Output one integer — answer to the problem.

Examples

Input

3
01010101


Output

216


Input

3
01101001


Output

168

Note

In first sample, result is always fully determined by the first voter. In other words, f(x1, x2, x3) = x1. Thus, any no matter what happens, there will be a candidate who won two rounds (more specifically, the candidate who is at the top of voter 1's preference list), so p = 1, and we print 1·63 = 216.
#include <bits/stdc++.h>
using namespace std;
long long pwr(long long base, long long p, long long mod = (1000000007LL)) {
  long long ans = 1;
  while (p) {
    if (p & 1) ans = (ans * base) % mod;
    base = (base * base) % mod;
    p /= 2;
  }
  return ans;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
void print_poly(const vector<int>& arr) {
  for (int i = 0; i < (int)arr.size(); i++) cout << i << ":" << arr[i] << " ";
  ;
}
int inv2;
vector<int> xor_transform(const vector<int>& poly1, const vector<int>& poly2,
                          int p) {
  vector<int> ans(1 << p, 0);
  if (p < 4) {
    for (int i = 0; i < (1 << p); i++)
      for (int j = 0; j < (1 << p); j++) {
        ans[i ^ j] = (ans[i ^ j] + 1LL * poly1[i] * poly2[j]) % (1000000007LL);
      }
    return ans;
  }
  int pp = p - 1;
  vector<int> poly11(1 << pp), poly12(1 << pp), poly21(1 << pp),
      poly22(1 << pp);
  for (int i = 0; i < (1 << pp); i++) {
    poly11[i] = (poly1[i] + poly1[(1 << pp) + i]) % (1000000007LL);
    poly12[i] = (poly1[i] - poly1[(1 << pp) + i]) % (1000000007LL);
    poly21[i] = (poly2[i] + poly2[(1 << pp) + i]) % (1000000007LL);
    poly22[i] = (poly2[i] - poly2[(1 << pp) + i]) % (1000000007LL);
  }
  vector<int> ans1 = xor_transform(poly11, poly21, pp);
  vector<int> ans2 = xor_transform(poly12, poly22, pp);
  for (int i = 0; i < (1 << pp); i++) {
    ans[i] = (ans1[i] + 1LL * ans2[i]) % (1000000007LL);
    ans[i] = (ans[i] * 1LL * inv2) % (1000000007LL);
    ans[(1 << pp) + i] =
        (ans1[i] - 1LL * ans2[i] + (1000000007LL)) % (1000000007LL);
    ans[(1 << pp) + i] = (ans[(1 << pp) + i] * 1LL * inv2) % (1000000007LL);
  }
  return ans;
}
char str[1 << 21];
int main() {
  int n;
  scanf("%d", &n);
  vector<int> F(1 << n, 0), notF(1 << n, 0);
  scanf("%s", str);
  for (int i = 0; i < (1 << n); i++)
    if (str[i] == '1')
      F[i] = 1;
    else
      notF[i] = 1;
  inv2 = pwr(2, (1000000007LL) - 2);
  vector<int> temp = xor_transform(F, notF, n);
  int ans = 0;
  for (int i = 0; i < (1 << n); i++) {
    int c = __builtin_popcount(i);
    ans = (ans + (1LL << c) * 1LL * temp[i]) % (1000000007LL);
  }
  ans = (ans * 3LL) % (1000000007LL);
  if (ans < 0) ans += (1000000007LL);
  printf("%d\n", ans);
  return 0;
}
